Skip to content

Instantly share code, notes, and snippets.

View aronwoost's full-sized avatar

Aron Woost aronwoost

View GitHub Profile
@aronwoost
aronwoost / gist:3755801
Created September 20, 2012 13:09
JSHint global's for tests with Mocha, expect.js and sinon.JS (work in progress)
{
"describe",
"xdescribe",
"it",
"xit",
"before",
"after",
"beforeEach",
"afterEach",
"expect",
@aronwoost
aronwoost / example1.js
Created July 30, 2012 19:43
Pseudo example code for saving text fragments in HTML (or epubs)
/*
Looking for "and".
Markup is the following:
<body>
<div id="text">Pride and Prejudice</div>
</body>
*/
var range = {
<script type="text/javascript">
document.addEventListener("touchmove", function(evt){
evt.preventDefault();
}, false);
var container = document.getElementById("container");
container.addEventListener("touchmove", function(evt){
evt.stopPropagation();
}, false);
<html>
<head>
<style>
...
#subcontainer {
height:100%;
overflow-y: auto;
}
...
</style>
-webkit-overflow-scrolling: touch;
@aronwoost
aronwoost / dir.sublime-snippet
Created March 26, 2012 12:14
Sublime Text 2 snippet for console.dir() TAB completion
<snippet>
<content><![CDATA[console.dir(${1:});]]></content>
<tabTrigger>dir</tabTrigger>
<scope>source.js</scope>
<description>console.dir()</description>
</snippet>
@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>
@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 / 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);
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'