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
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
// 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
# Parse the query string params. | |
# https://gist.github.com/brianmcallister/94d89b3c50b2b9e98f6d | |
# | |
# Examples | |
# | |
# If the query string is: | |
# test=test&foo&a=truee&bool=false&num=10 | |
# | |
# parseQueryParams() | |
# #=> {"test": "test", "foo": "", "a": "truee", "bool": false, "num": 10} |
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
# Private: Highlight individual words within the message text. | |
# | |
# text - Text to format. | |
# words - Array of words to highlight. | |
# | |
# Returns the formatted text. | |
highlightWords = (text, words = []) -> | |
return text if words.length is 0 | |
# Create a DOM element to contain the text so we can detect and handle |
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
# Public: Natural sort an array. | |
# https://gist.github.com/brianmcallister/f0e77c185f4a0d6f7172 | |
# Ported to CoffeeScript from: http://www.davekoelle.com/files/alphanum.js | |
# See: http://www.davekoelle.com/alphanum.html | |
# | |
# This function has been modified to support passing in an array as an | |
# argument, as opposed to attaching this function to the Array prototype. | |
# | |
# array - Array to natural sort. | |
# |
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
/*jslint devel: true, browser: true, indent: 2, nomen: true */ | |
/*global jQuery, Modernizr */ | |
// Load a polyfil for placeholder support | |
(function ($, Modernizr) { | |
'use strict'; | |
if (!Modernizr.input.placeholder) { | |
var Actions = { | |
focusInput: function () { |
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
/* | |
Apply pointer mixin. Uses a CSS3 pseudo element to apply a triangle. | |
https://gist.github.com/brianmcallister/2932442 | |
@param {String} [$side] Which side the pointer should stick out from. Defaults to top. | |
@param {String} [$size] Size of the pointer. Expects units, ex: 5px. Defaults to 5px. | |
@param {String} [$color] Color of the pointer. Defaults to white. | |
@param {String} [$type] Which kind of triange to make. Defaults to equilateral. | |
@param {Boolean} [$clockwise] If using a right triange, the direction the triange should be rotated. | |
@param {String} [$element] Which type of psuedo element to be used. Defaults to :after. |
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
@mixin replace-text-with-inline($img) { | |
@include hide-text; | |
width: image-width($img); | |
height: image-height($img); | |
background: center center no-repeat inline-image($img); | |
} |
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
/* | |
Set a background image sized for retina screens, with an option to use the image url or an inline image. | |
@param {String} $image Image to use. | |
@param {String} [$type] Type of image url to use. Default to an inline image. | |
*/ | |
@mixin retina-image($image, $type: 'inline') { | |
@include hide-text; | |
@if $type != 'inline' and $type != 'url' { | |
@warn 'Unknown usage type. Falling back to "url"'; |
OlderNewer