Skip to content

Instantly share code, notes, and snippets.

View matthewhudson's full-sized avatar

Matthew Hudson matthewhudson

View GitHub Profile
@matthewhudson
matthewhudson / ExampleClass.m
Created March 17, 2012 03:31 — forked from lukeredpath/ExampleClass.m
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end
@matthewhudson
matthewhudson / .osx
Created March 8, 2012 05:00 — forked from dennmart/.osx
Sensible defaults for Mac OS X Lion
# 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
@matthewhudson
matthewhudson / deploy.sh
Created February 8, 2012 20:10
Deploy Node.js to Heroku
# 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
@matthewhudson
matthewhudson / PLUGINS.md
Created January 15, 2012 22:09
My Favorite Things
@matthewhudson
matthewhudson / gist:1603502
Created January 12, 2012 22:21
Integrate Open Graph with Tumblr
<!-- Open Graph tags for your home page (index). -->
<meta property="og:site_name" content="{Title}" />
<meta property="fb:app_id" content="FACEBOOK_APPID"/>
<meta property="fb:admins" content="FACEBOOK_USERID" />
<meta property="og:description" content="{MetaDescription}" />
<meta property="og:locale" content="en_US" />
{block:IndexPage}
<meta property="og:image" content="{PortraitURL-128}" />
<meta property="og:title" content="{Title}" />
@matthewhudson
matthewhudson / POLICY
Created December 15, 2011 01:40
S3 Website Bucket
{
"Version":"2008-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::your.bucket.name/*"

A good commit message looks like this:

Header line: explaining the commit in one line

Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.

The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
@matthewhudson
matthewhudson / httpd.conf
Created December 13, 2011 03:37
A "ready-to-go" httpd.conf. Turns on .htaccess files, and some performance tuning.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
#
# Do NOT simply read the instructions in here without understanding
@matthewhudson
matthewhudson / duzournix
Created December 13, 2011 02:52
Basic EC2 LAMP stack.
# Install LAMP.
sudo yum install -y httpd php mysql-server mysql php-mysql
# Start Apache & MySQL.
sudo service httpd start
sudo service mysqld start
# Setup MySQL with root account credentials.
mysqladmin -u root password 'branches'