Skip to content

Instantly share code, notes, and snippets.

View aronwoost's full-sized avatar

Aron Woost aronwoost

View GitHub Profile
@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 / ref.sublime-snippet
Last active June 17, 2016 14:30
react jsx self executing function block
<snippet>
<content><![CDATA[{
(function(self){
${1:}
})(this)
}]]></content>
<tabTrigger>ref</tabTrigger>
<scope>source.js</scope>
<description>jsx self executing 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) {
<snippet>
<content><![CDATA[function() {
${1:}
}]]></content>
<tabTrigger>func</tabTrigger>
<scope>source.js</scope>
<description>function(){}</description>
</snippet>
@aronwoost
aronwoost / gziped_sync.sh
Last active April 27, 2017 11:11
gzip octopress files and sync them to S3 and CloudFront with s3cmd. Original script by Julian Schrittwieser (https://github.com/mononofu) - http://www.furida.mu/blog/2012/02/29/gzip-your-octopress.
#!/bin/bash
# compress the files if they aren't
find public/ -iname '*.html' -exec ./gzip_if_not_gzipped.sh {} \;
find public/ -iname '*.js' -exec ./gzip_if_not_gzipped.sh {} \;
find public/ -iname '*.css' -exec ./gzip_if_not_gzipped.sh {} \;
# change their name back
find public -iname '*.gz' -exec bash -c 'mv $0 ${0/.gz/}' {} \;
echo "gzipping successful"
@aronwoost
aronwoost / index.js
Created December 12, 2013 10:41
Octopress. Extract date from filename and add to post header.
var fs = require("fs");
var async = require("async");
var folder = "source/_posts";
fs.readdir(folder, function(err, result) {
async.each(result, function(file, callback){
var date = file.split("-").slice(0, 3).join("-"),
dateStr = "date: "+date+" 00:00:00 +0100";
@aronwoost
aronwoost / README.md
Last active July 16, 2018 08:15
How to install node.js and CouchDB on a Google Compute Engine instance

#How to install node.js and CouchDB on a Google Compute Engine instance

Start and ssh into instance

Make sure you have a Google Compute engine account, have a project created and the gcutil command line tool installed.

Since want to ssh without the gcutil tool, you need to a your ssh key to the instance in addition to the already existing google_compute_engine key (used for gcutil).

@aronwoost
aronwoost / README.md
Last active December 18, 2015 17:19
Backbone base template

python -m SimpleHTTPServer

@aronwoost
aronwoost / README.md
Last active April 3, 2019 11:22
HTML base template

python -m SimpleHTTPServer

@aronwoost
aronwoost / gist:4027441
Created November 6, 2012 20:50
log object
console.log(util.inspect(body, false, null));