Skip to content

Instantly share code, notes, and snippets.

View aronwoost's full-sized avatar

Aron Woost aronwoost

View GitHub Profile
<snippet>
<content><![CDATA[function() {
${1:}
}]]></content>
<tabTrigger>func</tabTrigger>
<scope>source.js</scope>
<description>function(){}</description>
</snippet>
@aronwoost
aronwoost / gist:4f27d5642f12406ed754
Created July 3, 2014 14:32
super-simple svg feature detection
<script>
function addClass(el, cl) {
el.className += ' ' + cl;
}
function supportsSVG() {
return !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', "svg").createSVGRect;
}
if(supportsSVG) {
@aronwoost
aronwoost / gist:116c17f9d98ae2c61eb7
Created April 24, 2015 14:27
fetch.js POST test
// copy-paste into console
fetch('https://api.github.com/gists', {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Hubot',
login: 'hubot',
@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 / 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>
-webkit-overflow-scrolling: touch;