This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[function() { | |
${1:} | |
}]]></content> | |
<tabTrigger>func</tabTrigger> | |
<scope>source.js</scope> | |
<description>function(){}</description> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[{ | |
(function(self){ | |
${1:} | |
})(this) | |
}]]></content> | |
<tabTrigger>ref</tabTrigger> | |
<scope>source.js</scope> | |
<description>jsx self executing function</description> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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', |
OlderNewer