Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Here are a few examples on how to use Lists and Dictionaries in Python. It's by no means exhaustive, just a quick reference.
0
1817
posted 17 years ago by chrisaiv
I just noticed in Firefox 3.5.2 that setting `disabled = true` for a focused text input seems to make it impossible to re-focus after setting `disabled = false`. The solution is to blur it before disabling.
0
2673
posted 17 years ago by cyberhobo
first of all i thank to our Creator and Mr.ImHugo for his Action script which i make the java script from it,its works fine and once again i gives thank him for his snippet
1
2011
posted 17 years ago by sujithfem
Ever needed to convert rgb to hex on your website, maybe you have a slider that handles rgb but your backend uses hex, this issue can be resolved easily be using the following code. Remember to keep in mind that php and html primarily uses hex colo...
1
1972
posted 17 years ago by scopefragger
Ever needed to use to background images in a table or div? It is possible b just using css. Although this is yet to be a standard safari will allow you to apply 2! Css backgrounds, however IE, FIRFOX and retro opera users will only see 1 !
1
2091
posted 17 years ago by scopefragger
I saw a lot of bad javascritp foreach examples ... so here is the best solution. See the link (german) for another snippet to iterate over object properties via foreach.
0
1203
posted 17 years ago by naden
Display the number of people following you on Twitter using this custom Twitter badge. The code simply returns a number so you can style it however you like.
1
2046
posted 17 years ago by neal_grosskopf
To run, save as twitterbackup.rb:
ruby twitterbackup.rb yourtwittername
1
2197
posted 17 years ago by beandr
Ever needed to restrict an images size? Or stop it from growing best the size of your div/table. It’s a horrible feeling when you see your nicely designed site get trashed by a single image because it’s a pixel or two too big! And if it’s a...
1
2365
posted 17 years ago by scopefragger
Ever needed to get the page your user is currently viewing? This can be done quickly in php all thanks to $_server.
3
1796
posted 17 years ago by scopefragger
Useful for controllers. Put this in your base class for easy caching on variable (GET, POST) dependent pages
0
1639
posted 17 years ago by iloveitaly
Sometimes you just need to mask a script or reject a user from a page this can be done effortlessly using a single line of code. Header location will allow you to redirect a user quickly and without them having any control over the action.
A good...
1
1757
posted 17 years ago by scopefragger
calendar module's mini calendar includes a needles 'empty day' div in every date cell. this kills them.
0
1784
posted 17 years ago by canarymason
Easy check (:
**UPD**
You can just use [version_compare()](http://ca.php.net/manual/en/function.version-compare.php) function.
1
1871
posted 17 years ago by kirik
For use in conjunction with the get_work function in the theme functions template, functions.php.
0
1642
posted 17 years ago by tylersticka
For use within The Loop, in your portfolio item page template.
0
1781
posted 17 years ago by tylersticka
This is the Aidan Lister PHP countdown, translated for use in Norway.
No more 133 days untill christmas, but insted 3 months and 3 weeks.
0
2025
posted 17 years ago by stavelin
This is just a simple function to get the variable without having to worry if its POST or GET, and even allows for a default value to be passed in case the variable was not found.
0
1753
posted 17 years ago by mondomondomxcom