Skip to content

Instantly share code, notes, and snippets.

@indefinit
indefinit / grids.scss
Created April 23, 2014 11:27
Grids+Type+Queries - start of a micro css layout framework
@import "typography";
@import "mediaqueries";
$top-offset: 25%; //how much we want to offset our row from the top
/**
* From Nicolas Gallagher, "micro clearfix hack"
* http://nicolasgallagher.com/micro-clearfix-hack/
@indefinit
indefinit / gist:7451808
Created November 13, 2013 16:20
Linear transformation (Math) - map a value from one range to another
//map a value from one range to another
function mapVal(value, start1, stop1, start2, stop2) {
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
}
@indefinit
indefinit / gist:4750403
Created February 10, 2013 17:49
JS: parseJsonResponse callback function
// A callback function for parsing json
function parseJsonResponse(json) {
for(var obj in json ) {
if (json.hasOwnProperty(obj)) {
var data = json[obj];
//have fun with your data object here.