Overriding ActiveRecord's find method
0
Celebhir
This function takes a directory, and a "folder" search parameter.
If it finds the directory (either in single level, or any sub folder) it will return the relative path of that folder. "FALSE" if not found. Skips over files and "." and ".." directories. Recursive by default.
If it finds the directory (either in single level, or any sub folder) it will return the relative path of that folder. "FALSE" if not found. Skips over files and "." and ".." directories. Recursive by default.
0
Usage:
found('asdf',@array);
P.S. In perl 5.10 can be written as
use 5.010;
'asdf'~~@array;
found('asdf',@array);
P.S. In perl 5.10 can be written as
use 5.010;
'asdf'~~@array;
1
A quick implementation of an encrypter which can't be cracked by frequency analysis.
1
The decrypter for the simple encrypter I posted earlier - Takes the encrypted text from a text file - "encrypt.txt" which the encrypter automatically writes to.
1
A simple algorithm to convert decimal numbers to binary; pointless since most languages have an inbuilt function but was used for learning about algorithm design.
1
Directory Utility for Ruby
1
By default, migrations will run on the development environment. Here's how you would specify another environment.
2
Well, ruby is actually so flexible that there is no real need to implement the goode olde signals & slots metaphor. But it serves nicely as demonstration of ruby properties, so here we go.
4
This will render a flash div only if there is a message in flash. Also will set the id to the flash key.
flash[:notice] returns
This is the notice
flash[:notice] returns
This is the notice
4
berkeley_mikeg
I have created this sippet because I VPN into work to check problems or e-mail and had to change my IE settings to surf the internet. With this sippet, once configured will allow you to override your internet explorer proxy settings to connect and browse the internet with one double click of the mouse or as I have done, add it to my VPN profile auto starter and it reconfigures my internet browser after i'm connected.
(this will shut the browser if it's running, make the changes and launch it with the changed configuration)
(this will shut the browser if it's running, make the changes and launch it with the changed configuration)









