Skip to content

Instantly share code, notes, and snippets.

Aron Woost aronwoost

View GitHub Profile
View gist:116c17f9d98ae2c61eb7
// 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 Jun 17, 2016
react jsx self executing function block
View ref.sublime-snippet
<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 Jul 3, 2014
super-simple svg feature detection
View gist:4f27d5642f12406ed754
<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) {
View func.sublime-snippet
<snippet>
<content><![CDATA[function() {
${1:}
}]]></content>
<tabTrigger>func</tabTrigger>
<scope>source.js</scope>
<description>function(){}</description>
</snippet>
@aronwoost
aronwoost / gziped_sync.sh
Last active Apr 27, 2017
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.
View gziped_sync.sh
#!/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 Dec 12, 2013
Octopress. Extract date from filename and add to post header.
View index.js
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 Jul 16, 2018
How to install node.js and CouchDB on a Google Compute Engine instance
View README.md

#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 Dec 18, 2015
Backbone base template
View README.md

python -m SimpleHTTPServer

@aronwoost
aronwoost / README.md
Last active Apr 3, 2019
HTML base template
View README.md

python -m SimpleHTTPServer

View gist:4027441
console.log(util.inspect(body, false, null));
You can’t perform that action at this time.