This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.mongodb.mongod</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/mongodb-osx-x86_64-2.4.6/bin/mongod</string> | |
<string>run</string> |
This file contains 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
Process.kill "SIGUSR1", $$ # kills Torquebox & Passenger | |
exit(false) # only kills Webbrick |
This file contains 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
#!/usr/bin/env ruby | |
require 'date' | |
re_line1 = /^\[b([\d,]+)h\](.*)/ | |
re_line2 = /^scheduled (.*)/ | |
total_hours = 0.0 | |
STDIN.each_slice(3) { |entry| # iterate per 3 lines | |
hours_and_description, schedule = entry[0], entry[1] |
This file contains 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
// Maps Emacs style "Escape, Backspace" to Delete Word Backward | |
{ "keys": ["escape", "backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true } } |
This file contains 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
Completed 200 OK in 12ms (Views: 0.0ms | ActiveRecord: 0.0ms) |
This file contains 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' | |
require 'uri' | |
require 'benchmark' | |
class Time | |
def to_Iso8601GmtDate | |
ConvertibleAttributes::Iso8601GmtDate.call(self) | |
end | |
end |
This file contains 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
foo = {:foo => "bar", :olaf => "polaf"} | |
bar = 2 | |
def olaf(one, two = one[:foo]) | |
puts "#{one} - #{two}\n" | |
end | |
olaf(foo) | |
olaf(foo, bar) |
This file contains 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
NSFileHandle *aFileHandle; | |
NSString *aFile; | |
aFile = [NSString stringWithString:@"Your File Path"]; //setting the file to write to | |
aFile = [logFile stringByExpandingTildeInPath]; | |
aFileHandle = [NSFileHandle fileHandleForWritingAtPath:aFile]; //telling aFilehandle what file write to | |
[aFileHandle truncateFileAtOffset:[aFileHandle seekToEndOfFile]]; //setting aFileHandle to write at the end of the file | |
[aFileHandle writeData:[toBeWritten dataUsingEncoding:nil]]; //actually write the data |
This file contains 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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.mongodb.mongod</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/Cellar/mongodb/2.0.0-x86_64/bin/mongod</string> | |
<string>run</string> |
NewerOlder