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
#!/bin/bash | |
launchctl list | |
launchtl load /Library/LaunchDaemons/org.redis.redis-server.plist | |
launchctl reload /Library/LaunchDaemons/org.redis.redis-server.plist | |
launchctl stop /Library/LaunchDaemons/org.redis.redis-server.plist | |
launchctl restart /Library/LaunchDaemons/org.redis.redis-server.plist | |
launchctl unload -w org.darwinports.postgresql84 sudo launchctl load -w org.darwinports.postgresql84 | |
launchctl unload -w org.darwinports.postgresql84 sudo launchctl load -w org.darwinports.postgresql84 |
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
# in ~/.screenrc | |
# .bash_profile is only sourced for login shells, opening a screen does not source it | |
shell -$BASH |
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
database: <%= File.basename(RAILS_ROOT) %>_<%= `git symbolic-ref | |
HEAD`.match(/.*\/(.*)\n/)[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
def validate_ip_address | |
valid_ip_address = begin; IP.new(self.ip_address); rescue; end | |
unless ignore_nil{ valid_ip_address.is_a?(IP::V4) } | |
if target == "appliance" | |
self.errors.add_to_base I18n.t(:invalid_ipv4, :scope => | |
TRANSLATE_BASE_SCOPE, :ip_address => self.ip_address) | |
else | |
self.errors.add(:ip_address, I18n.t(:invalid_ipv4, :scope => | |
TRANSLATE_BASE_SCOPE, :ip_address => self.ip_address)) | |
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
If this is your first install, create a database with: | |
initdb /usr/local/var/postgres | |
If this is your first install, automatically load on login with: | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist | |
If this is an upgrade and you already have the org.postgresql.postgres.plist loaded: | |
launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
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>/opt/mongodb/bin/mongod</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
<?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> |
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 |