This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails Singleton Model | |
Taken from: | |
http://stackoverflow.com/questions/399447/how-to-implement-a-singleton-model/12463209#12463209 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following to your .bash_profile or .bashrc file in order to switch to a different iTerm profile during an ssh session. | |
# This same code could be re-purposed for any command, not just ssh | |
# Set iTerm2 Profile | |
set_iterm_profile() { | |
echo -e "\033]50;SetProfile=$1\a" | |
} | |
# Switch iTerm2 Profile during SSH Sessions | |
ssh() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Tar (with date) | |
tar czvf [foldername_$(date +%m%d%Y).tar.gz] [/folder/to/archive] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the database, there is a table called `countries` with a `name` field. | |
The database contains the following entries for countries: | |
Canada, Mexico, Argentina, Brazil, United States, Ireland, North Korea, Other | |
*/ | |
/* | |
Order by a specific field, while moving one or more items to the beginning | |
*/ |