Skip to content

Instantly share code, notes, and snippets.

View matthewhudson's full-sized avatar

Matthew Hudson matthewhudson

View GitHub Profile
@matthewhudson
matthewhudson / jQuery External Link _target=blank
Created October 26, 2011 16:12
Automatically open external links in a new window.
@matthewhudson
matthewhudson / JavaScript Class
Created November 1, 2011 19:31
Best-practive JavaScript class: "that" is public, "my" is private to the object.
var constructor = function (spec, my) {
var that = {};
var my = my || {};
// This function is private.
my.privateFunction = function() {
return true;
};
// This function is public.
@matthewhudson
matthewhudson / hackerhub.json
Created December 12, 2011 15:36
Hackerhub Profile
{
"settings" : {
"id" : "matthewhudson",
"name" : "Matthew Hudson",
"avatar" : "http://www.matthewghudson.com/Matthew-Hudson.jpg",
"enable_search" : true
},
"content" : {
"tumblr" : {
"title" : "Blog",
@matthewhudson
matthewhudson / Ubuntu s3fs install
Created December 13, 2011 01:50
Ubuntu s3fs install & dependencies.
# Install prerequisites before compiling:
apt-get install build-essential
apt-get install libfuse-dev
apt-get install fuse-utils
apt-get install libcurl4-openssl-dev
apt-get install libxml2-dev
apt-get install mime-support
# Download and Install
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
@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'
@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

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 / 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/*"
@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 / PLUGINS.md
Created January 15, 2012 22:09
My Favorite Things