Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
The shell command which provides documentation for Ruby's classes and methods is:
0
903
posted 15 years ago by deepsoul
Sample log line:
[INFO] 2009-03-06 20:47:35 | controller::bla | user: vincentvega | ip: 127.0.0.1
0
1070
posted 15 years ago by benjay
Must have a field named Weight. The more Weight the more often the record is selected. Weight should be an integer between 1 and 10.
1
1096
posted 15 years ago by BFTrick
I have not tried this out yet, but I hope it can convert IronPython types to and from json.
0
1007
posted 15 years ago by laurenceosx
Variables that are submitted via web forms always need to be cleaned/sanitized before use in any way, to prevent against all kinds of different malicious intent.
0
907
posted 15 years ago by paulgrenwood
Just include this script on the site and you’ll get a Firebug console that pops up for debugging in any browser. Not quite as full featured but it’s still pretty helpful! Remember to remove it when you are done.
1
974
posted 15 years ago by paulgrenwood
this comes from YAPB plugin for WordPress. kudos to the author.
(there are some functions that are deprecated in PHP 5.2+ - you'll need to replace eregi with the mb_ version). This should be quite failsafe, regardless if curl is installed or the set...
1
1322
posted 15 years ago by iroybot
note t0 self - place inside class declaration with vars
- include Flex SDK swc (flash CS4)
2
1081
posted 15 years ago by obsessivejosh
note to self - Basic settings for clean text in as3 flash project assuming fonts are embedded.
0
846
posted 15 years ago by obsessivejosh
Sometime it is convenient to get recursive directory listing as array of items
directory => (file array)
Such as:
Array
(
[./a2temple] => Array
(
[0] => example13.zip
)...
2
862
posted 15 years ago by artoodetoo
Read in a remote XML file, change the pubDate date format, and output to specific local file.
0
1038
posted 15 years ago by karlhorky
If you want to set the active menu trail in a node, simply add this to your template.php in the 'template preprocess node' function.
0
788
posted 15 years ago by ccalnan
MySQL Insert Unique Reference using MAX() to obtain latest value
Alternate solution to using Composite Primary Keys which INNODB engine does not support.
0
1051
posted 15 years ago by cherbert
To make an image browser, add these lines:
$ext = strtolower(substr("$dirArray[$index]", strrpos("$dirArray[$index]", '.') + 1)); //get file extensions
if ("$ext" == "jpg") { // if file is a jpg
print("<TR><TD>$dirArray[$index]<br/><a href=\...
1
999
posted 15 years ago by beneberle