Skip to content

Instantly share code, notes, and snippets.

View aronwoost's full-sized avatar

Aron Woost aronwoost

View GitHub Profile
@aronwoost
aronwoost / gist:1000402
Created May 31, 2011 12:11
Exclude private ip addresses from google analytics tracking
(function(){
var re = /(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|localhost/;
if(re.test(window.location.hostname)) return;
var _gaq=[['_setAccount','UA-23156659-1'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
})();
@aronwoost
aronwoost / README.md
Created July 25, 2011 19:46
How to install LAMP on a EC2 Amazon AMI

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

@aronwoost
aronwoost / README.md
Created July 25, 2011 19:48
Build auto-deploy with php and git(hub) on an EC2 Amazon AMI instance

Kind of continue from the other gist how to install LAMP on an Amazon AMI

##Install git

sudo yum install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI

@aronwoost
aronwoost / README.md
Created August 9, 2011 14:47
Super basic implementation of the monocle framework (for displaying html files in book form)

This gist should give you a starting point, of how to implement the monocle framework.

The framework can much more. Check the examples in the test folder.

Make sure you have the monocle framework present in the folder js. You should clone it with git but you can also download it via the Download button.

@aronwoost
aronwoost / index.html
Created August 24, 2011 19:20
Retrieve "anonymously" data from a foursquare checkin. You don't need to follow the person who checked in. However, the checkin must have been made public (e.g. via twitter)
<!DOCTYPE html>
<head>
<title>4sq image request</title>
<script type="text/javascript" src="jquery-1.6.2.js"></script>
<script type="text/javascript">
// set the following appropriately
var testUrl4sq = "XXX",
bitlyUsername = "XXX",
bitlyApiKey = "XXX",
@aronwoost
aronwoost / kafka.html
Created September 15, 2011 16:41
Kafka test file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Kafka</title>
</head>
<body>
<div><p>Jemand mußte Josef K. verleumdet haben, denn ohne daß er etwas
Böses getan hätte, wurde er eines Morgens verhaftet. Die Köchin der
Frau Grubach, seiner Zimmervermieterin, die ihm jeden Tag gegen
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Epub.date_published'
@aronwoost
aronwoost / gist:1582537
Created January 9, 2012 11:14
Basic JavaScript performance test
var start = new Date();
for (var i=0; i < 10; i++) {
// the action
};
diff = new Date() - start;
console.log(diff);
@aronwoost
aronwoost / gist:1986185
Created March 6, 2012 13:10 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@aronwoost
aronwoost / log.sublime-snippet
Created March 26, 2012 12:14
Sublime Text 2 snippet for console.log() TAB completion
<snippet>
<content><![CDATA[console.log(${1:});]]></content>
<tabTrigger>log</tabTrigger>
<scope>source.js</scope>
<description>console.log()</description>
</snippet>