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
// Extract values from a nested map. | |
// Original: https://gist.github.com/jackie/a65bb078c8c9eb4bbb57 | |
// | |
// $map - Map from which to extract the value. | |
// $keys - List of keys. | |
// | |
// Examples | |
// | |
// $map: (one: (two: val: 'value')); | |
// map-me($map, one two val); |
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
class BaseView extends Backbone.View | |
# Public: Events. | |
events: {} | |
# Public: Constructor. | |
# | |
# Returns this. | |
constructor: -> | |
# Inherit events. | |
cls = this |
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
{ | |
"desktop": { | |
"min": 801 | |
}, | |
"tablet": { | |
"min": 481, | |
"max": 800 | |
}, | |
"phone": { | |
"max": 480 |
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
# Custom Sass function to get a list of images in a directory. | |
# https://gist.github.com/brianmcallister/5824102 | |
# | |
# path - Directory in which to get svg images. Defaults to a blank string. | |
# | |
# Returns a list of images. | |
def get_svg_images(path = Sass::Script::String.new('')) | |
assert_type path, :String | |
files = [] |
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
$states: state1 #00adee, state2 #ffc10e, state3 #ec145a; | |
$color_selectors: null; |
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
/* | |
Replace text with svg, use a png fallback. | |
https://gist.github.com/brianmcallister/5065262 | |
$img - Image name to use, no extension. | |
*/ | |
@mixin replace-text-with-svg($img) { | |
@extend %hide-text; | |
$png: '#{$img}.png'; |
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
# Class for using localStorage to cache data for a set amount of time. | |
# https://gist.github.com/brianmcallister/5000368 | |
# | |
# name - Name for this cache. | |
# | |
# Examples | |
# | |
# cache = new Cache('my-cache').set 'my-data', {data: 'hats'}, 120 | |
class Cache | |
# Private: Just a function that returns null. |
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 | |
# Archive old projects | |
# | |
# - Create a tar.gz file out of a folder | |
dir=~/Archive | |
# Echo a message. TODO - Colors. | |
function msg() { | |
echo "> $*" >&2 |
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
// Transition end event shim. | |
// https://gist.github.com/brianmcallister/4444457 | |
this.Modernizr.transEndEventName = { | |
'WebkitTransition': 'webkitTransitionEnd', | |
'MozTransition': 'transitionend', | |
'transition': 'transitionend' | |
}[this.Modernizr.prefixed('transition')]; |
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
# Wrapper around Ruby's Array#index method. | |
# https://gist.github.com/brianmcallister/4341575 | |
# | |
# value - The value in the list to search for. | |
# list - The list to search through. | |
# | |
# Examples | |
# | |
# $list: a b c; | |
# @debug location(b, $list); |