Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This is the code I use when I want to test a helper.
It uses Factory Girl and Shoulda, but they're not needed to make it work.
0
1205
posted 15 years ago by nflamel
Easily grabs email addresses from a bulk text (CSV and/or some other email address-filled list/db).
Example #2 takes the input (bulk text) from textarea #input and puts the clean emails in the textarea #extractedemails.
1
3355
posted 15 years ago by world_eggplant
Found on [Corey Goldberg's blog](http://coreygoldberg.blogspot.com/2010/01/python-command-line-progress-bar-with.html). Usage:
from progress_bar import ProgressBar
p = ProgressBar(60)
p.update_time(15)
print p
p.fill_char =...
0
667
posted 15 years ago by ctmiller
Originally found on [Corey Goldberg's blog](http://coreygoldberg.blogspot.com/2010/01/python-command-line-progress-bar-with.html)
0
804
posted 15 years ago by codeshaman
<p>This zips all files and directories</p>
<p>-r:Includes all files and directories -> Files</p>
<p>filename.zip:The zip file you want to create</p>
<p>foldername:The folder you are targetting or use * if your currently in the folder</p>
0
4695
posted 15 years ago by kevinbanet
Easy way to add belongs_to association to nested forms in Rails
0
1181
posted 15 years ago by viatropos
PHP provides many date manipulation devices and an entire suite of date functionality with the datetime class. However, this does not address date validation, that is, what format a date is received in. The PHP strtotime() function will accept many f...
1
1403
posted 15 years ago by kanampo
This will need to be either embeded or included and you can then just use this as such
myNewString = myStringVariable.nl2br();
0
1057
posted 15 years ago by boondoklife
Snippet out of my C# KNN implementation.
Uses leave-one-out cross validation tuning with our given K to find our nearest neighbors.
0
1156
posted 15 years ago by ahawker