Welcome To Snipplr
Everyone's Recent Snippets
- All /
 - JavaScript /
 - HTML /
 - PHP /
 - CSS /
 - Ruby /
 - Objective C
 
Haven't had a chance to use this but it looks very promising.
        
        
        
            14 
        
        
            2063 
        
                    posted 18 years ago by aznprncritic
            A low-tech but useful technique that uses only CSS.  After placing the css in your stylesheet, insert this just below the body tag of your page: "".  Whenever the images are referenced throughout your pages they will now be loaded from cache.
        
        
        
            0 
        
        
            11038 
        
                    posted 18 years ago by aznprncritic
            A great script that will serve up stylesheets based on browser viewport size.
        
        
        
            5 
        
        
            1910 
        
                    posted 18 years ago by aznprncritic
            Use this to sanitize a string and convert all wierd characters to your choice of delimiter
        
        
        
            1 
        
        
            1226 
        
                    posted 18 years ago by vanne
            Define multiple associations on the same associated class.  From the Rails Way blog.
        
        
        
            1 
        
        
            1002 
        
                    posted 18 years ago by gnatware
            The very basic markup for the enhancement DOM script from a tutorial.
        
        
        
            0 
        
        
            986 
        
                    posted 18 years ago by 1man
            This is another script from the DOM scripting book. Not really relevant to anybody else. Useful for reminding myself about the DOM.
        
        
        
            1 
        
        
            1186 
        
                    posted 18 years ago by 1man
            This PHP4 function will increment a given string by a given interval. This might be useful when a string has to be unique. An optional array with "forbidden" return values may be passed.
Usage:
        
        
        
            2 
        
        
            1521 
        
                    posted 18 years ago by drwitt
            Not really relevant to anybody else. Full unobtrusive js file for a simple gallery. From DOM Scripting by Jeremy Keith (superb book, highly recommend it for anyone looking to move into DOM scripting)
        
        
        
            2 
        
        
            1325 
        
                    posted 18 years ago by 1man
            Vert useful function since there isn't an insertAfter function in the DOM. Call it inside scripts, it expects
insertAfter(*the new element to be inserted*, *the element you want it to be inserted after*);
        
        
        
            3 
        
        
            2900 
        
                    posted 18 years ago by 1man
            Works in IE. 
FF 1.5 hides URL, but does not show displayed url.
        
        
        
            3 
        
        
            1453 
        
                    posted 18 years ago by tohagan
            when testing forms you don't always want to fill in dummydate
this is a function i used to autofill and select values.
        
        
        
            1 
        
        
            1194 
        
                    posted 18 years ago by assbach
            it's an excerpt of a registration form with 3 pulldowns for birthday ( day, month, year )
check for empty vars and applying CSS classes to show error on "empty" fields.
there are probably better ways, but this works for me. any suggestions welcome.
        
        
        
            1 
        
        
            3521 
        
                    posted 18 years ago by assbach
            This replaces the PHP-based function in the HTML bundle.  You need to add two files to your bundle's Support/lib folder (create the directories if they're not present):
http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_controller/vend...
        
        
        
            6 
        
        
            2868 
        
                    posted 18 years ago by gtcaz