Skip to content

Instantly share code, notes, and snippets.

View asterick's full-sized avatar

Bryon Vandiver asterick

View GitHub Profile
@asterick
asterick / grid.scss
Last active June 12, 2018 07:05
Variable column grid system with ratios ala PURE in very little SCSS
// Globals
$screen-width: 1280px;
// Grid
$column-granularity: 12;
$column-gutter: 20px;
// Dimensions (responsive)
$screen-xs-max: 567px;
$screen-sm-min: 568px;
@asterick
asterick / esi.js
Created May 1, 2014 00:21
Replace all unrealized ESI's on a page (good for bookmarklets)
Array.prototype.forEach.call(document.getElementsByTagName("esi:include"),function(e){function r(e){n.after(e);console.log(t,"loaded");sessionStorage[t]=JSON.stringify({ts:+(new Date)+1e3*60*30,value:e})}var t=e.getAttribute("src"),n=$(e);if(sessionStorage[t]){var i=JSON.parse(sessionStorage[t]);if(i.ts>+(new Date)){r(i.value);return}}if(e.getAttribute("processed")){return}e.setAttribute("processed",true);var s=new XMLHttpRequest;s.open("GET",t,true);s.send();console.log("Loading",t);s.onreadystatechange=function(){if(s.readyState!==4){return}r(s.responseText)}})
@asterick
asterick / chicken.js
Last active August 29, 2015 14:00 — forked from StoneCypher/chicken.js
(function(word) {
var walk=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,false), el;
word=word.split("");
while(el=walk.nextNode()) {
el.nodeValue = el.nodeValue.replace(/\w+/g, function (o) {
return word.map(function (v, i) {
return (o[i] < "a") ? v.toUpperCase() : v;
}).join("");
});
}
functon onReturn(resp) {
if (resp.status === 200) {
// SUCCESS!
} else {
// BOOO
}
}
$http(...).then(onReturn, onReturn);