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 the app on the Cedar stack using a custom buildpack: | |
heroku create --stack cedar --buildpack http://github.com/heroku/heroku-buildpack-nodejs.git | |
# Creating sharp-rain-871... done, stack is cedar | |
# http://sharp-rain-871.herokuapp.com/ | [email protected]:sharp-rain-871.git | |
# Git remote heroku added | |
# Rename the application. | |
heroku rename newname | |
git push heroku master |
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
# Expand save panel by default | |
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true | |
# Disable the “Are you sure you want to open this application?” dialog | |
defaults write com.apple.LaunchServices LSQuarantine -bool false | |
# Disable shadow in screenshots | |
defaults write com.apple.screencapture disable-shadow -bool true | |
# Automatically open a new Finder window when a volume is mounted |
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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@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
// Documents directory | |
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains( | |
NSDocumentDirectory, | |
NSUserDomainMask, YES) | |
objectAtIndex:0]; | |
NSString *dataPath = [documentsPath stringByAppendingPathComponent:@"folderName"]; | |
// Create folder if does not exist. | |
if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath]) { |
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
// The bounds of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to its own coordinate system (0,0). | |
NSLog(@"bounds.origin.x: %f", thing.bounds.origin.x); | |
NSLog(@"bounds.origin.y: %f", thing.bounds.origin.y); | |
NSLog(@"bounds.size.width: %f", thing.bounds.size.width); | |
NSLog(@"bounds.size.height: %f", thing.bounds.size.height); | |
// The frame of an UIView is the rectangle, expressed as a location (x,y) and size (width,height) relative to the superview it is contained within. | |
NSLog(@"frame.origin.x: %f", thing.frame.origin.x); | |
NSLog(@"frame.origin.y: %f", thing.frame.origin.y); | |
NSLog(@"frame.size.width: %f", thing.frame.size.width); |
Quickly generate web, mobile and social icons.
Your new project needs icons. Different platforms have different icon guidelines. This project seeks to condense those requirements into a single script that handles all the technical guidelines.
Provide the script a single image and it will generate everything you need.
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
# Install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" | |
# Install rvm | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
rvm install 1.9.2 | |
rvm install jruby | |
rvm use 1.9.2 --default |
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
<?php | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
} | |
function the_facebook_graph_data() { | |
// setup the default site attributes | |
$graph; | |
$graph["site_name"] = "YOUR_SITE_NAME"; |