Skip to content

Instantly share code, notes, and snippets.

View krambuhl's full-sized avatar
❤️
I love you!

Eevee Kreevee krambuhl

❤️
I love you!
  • Boogie Woogie Industrial Complex
  • Portland, Oregon
  • 05:03 (UTC -07:00)
View GitHub Profile
@krambuhl
krambuhl / backbone.jsonp-collection.js
Created March 2, 2014 05:46
Backbone Jsonp Collection. only supports simple get commands.
Backbone.JsonpCollection = Backbone.Collection.extend({
sync: function(method, model, options) {
var params = _.extend({
type: 'GET',
url: this.url,
dataType: "jsonp",
processData: false
}, options);
return $.ajax(params);
@krambuhl
krambuhl / slice.scss
Last active August 29, 2015 13:56
A general layout module for creating columns.
.slice {
display: table;
table-layout: fixed; // makes items equal sizes automatically
width: 100%;
}
.slice-auto {
table-layout: auto; // items will resize based on content size
}
@krambuhl
krambuhl / mixins.animations.scss
Created January 23, 2014 04:58
Simple sass animation mixins
@mixin animation($animate...) {
$max: length($animate);
$animations: '';
@for $i from 1 through $max {
$animations: #{$animations + nth($animate, $i)};
@if $i < $max {
$animations: #{$animations + ", "};
}
@krambuhl
krambuhl / grid.scss
Last active December 21, 2015 09:28
Sass responsive grid implimentation
$grid-max: 12;
$grid-column: 80px;
$grid-gutter: 0px;
@function gridw ($span: $grid-max, $offset: 0px) {
@return ($grid-column * $span) + ($grid-gutter * ($span - 1)) + $offset;
}
@mixin grid ($span: $grid-max, $offset: 0px) {
width: gridw($span, $offset);
@krambuhl
krambuhl / gist:5520479
Created May 5, 2013 10:53
percentBetween
var percentBetween = function(n1, n2, pos) {
return Math.floor(pos * n2) + n1;
};
@krambuhl
krambuhl / gist:5139824
Last active December 14, 2015 19:49
Mustache/jQuery wrapper: Loads a mustache template via ajax: onsuccess, mustache template is rendered (on all matched contexts). if callback is defined, it will be called.
var renderTemplate = function(context, source, data, callback) {
$.get(source, function(template){
$(context).html($.mustache(template, data));
if (typeof callback === "function")
callback.call(this, context);
});
};