| Description | Command |
|---|---|
| Start a new session with session name | screen -S <session_name> |
| List running sessions / screens | screen -ls |
| Attach to a running session | screen -x |
| Attach to a running session with name | screen -r |
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
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
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
| require 'net/http' | |
| def post_xml url_string, xml_string | |
| uri = URI.parse url_string | |
| request = Net::HTTP::Post.new uri.path | |
| request.body = xml_string | |
| request.content_type = 'text/xml' | |
| response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request request } | |
| response.body | |
| end |
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
| ========================================== ========================================== | |
| TMUX COMMAND WINDOW (TAB) | |
| ========================================== ========================================== | |
| List tmux ls List ^b w | |
| New -s <session> Create ^b c | |
| Attach att -t <session> Rename ^b , <name> | |
| Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
| Kill kill-session -t <session> Close ^b & |
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
| require 'rest-client' | |
| require 'json' | |
| client_id = '4ea1b...' | |
| client_secret = 'a2982...' | |
| code = '7fad4488afa56cefdefa7ff6ff0bd3a9e2d26b7648672c4bba7de5a0427bd6c7' | |
| response = RestClient.post "https://bsmart.it/oauth/token", { | |
| code: code, | |
| client_id: client_id, |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
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
| SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'hachette_development' AND pid <> pg_backend_pid(); |
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
| // Fetch NSDictionary containing possible saved state | |
| NSString *errorDesc = nil; | |
| NSPropertyListFormat format; | |
| NSString *plistPath; | |
| NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
| NSUserDomainMask, YES) objectAtIndex:0]; | |
| plistPath = [rootPath stringByAppendingPathComponent:@"SavedState.plist"]; | |
| NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath]; | |
| NSDictionary *unarchivedData = (NSDictionary *)[NSPropertyListSerialization | |
| propertyListFromData:plistXML |
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
| RUBYOPT=-rrubygems bundle install | |
| RUBYOPT=-rrubygems gem install libv8 |
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
| git config --global alias.co checkout | |
| git config --global alias.ci commit | |
| git config --global alias.po "push origin" | |
| git config --global alias.st status | |
| git config --global alias.lo "log --oneline" |