Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
* Resized images are generated into TARGET_DIR.
* Change the resolution (800x800 in my example) and quality (80) as you want.
* The command keeps the image's proportion. 1600x1200 will be converted into 800x600, 1200x1600 into 600x800.
_Notice_:...
        
        
        
            2 
        
        
            1850 
        
                    posted 16 years ago by Dorgendubal
            This example demonstrates interpolation using Excel's =TREND function by converting 70 degrees F to 21 Celcius.
=TREND({0,100},{32,212},70)
The {..} arrays can of course be replaced with a cell range specifier.
        
        
        
            0 
        
        
            1394 
        
                    posted 16 years ago by jimfred
            Database backup function that you can call whenever you want — including nightly CRONs.
        
        
        
            6 
        
        
            2618 
        
                    posted 16 years ago by fackz
            Founds this via http://www.flashcomguru.com/index.cfm/2009/2/17/regexp-validate-url
        
        
        
            1 
        
        
            1533 
        
                    posted 16 years ago by allnatural
            Use instead of standard "sql\_tablesort()" function. Handles multiple "sort" in $header, but the arrow will be only on last sorted column. This can be handled with rewriting theme_table, for example.
        
        
        
            0 
        
        
            1210 
        
                    posted 16 years ago by kurokikaze
            Here's a quick snippet of code to raise the minimum age of your site. Note that it is illegal to lower the legal age of your site under 13.
Legal Disclaimer: Affiliate shall indemnify and hold KickApps, its licensors and each such party's parent o...
        
        
        
            0 
        
        
            1038 
        
                    posted 16 years ago by krunkosaurus
            These 4 lines of code can be used to extract and return all links from any page using regex patterns. If links are found, an array is returned, else boolean false is returned.
        
        
        
            4 
        
        
            2125 
        
                    posted 16 years ago by gdvickery
            This method is a bit faster and more reliable then using the "explode" method. Works with PHP 4.0.3 and up.
        
        
        
            4 
        
        
            1704 
        
                    posted 16 years ago by gdvickery
            Alternative to 
[http://snipplr.com/view/12616/strip-url-to-its-domain-name/](http://snipplr.com/view/12616/strip-url-to-its-domain-name/, "this snippet"), as it didn't come out clearly in the comments.
Update - Edited based on gdvickery's commen...
        
        
        
            3 
        
        
            1799 
        
                    posted 16 years ago by duniyadnd
            Very simple snippet to include if you want to auto update the year in a page copyright using PHP.
        
        
        
            6 
        
        
            1644 
        
                    posted 16 years ago by 1man
            
