This file contains hidden or 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
var _ = require('lodash'); | |
// var _ = require('underscore'); | |
function existy(x) { | |
return x !== undefined && x !== null; | |
} | |
function truthy(x) { | |
return x !== false && existy(x); | |
} |
This file contains hidden or 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
//---------------------------------------------------------------------- | |
// Create a 2 color, linear gradient SVG image - default of vertical | |
// @function linearGradientToSVG | |
// @param {rgba} $colorA first color (top/left) of the gradient | |
// @param {rgba} $colorB second color (bottom/right) of the gradient | |
// @param {string} $orientation expects vertical or horizontal | |
// @returns {url} | |
//---------------------------------------------------------------------- | |
@function linearGradientToSVG($colorA, $colorB, $orientation: vertical) { | |
@if $orientation == vertical { |
This file contains hidden or 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
//---------------------------------------------------------------------- | |
// Convert a number to specified unit | |
// @function unit | |
// @param {number} $num number to be converted to unit | |
// @param {string} $units unit number will be converted to | |
// @returns {string} | |
//---------------------------------------------------------------------- | |
@function unit($num, $units) { | |
@return #{$num}#{$units}; | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized (dark)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains hidden or 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
// # YTVideoLoader.js | |
// Doc: [] | |
// ## Namespacing | |
// * Namespace YTVideoLoader Object | |
// ### Public Methods Available: | |
// * YTVideoLoader.confirmAPIReady() | |
// * YTVideoLoader.destroyPlayer() | |
// * YTVideoLoader.playerControl() | |
// * YTVideoLoader.buildPlayer() |
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
/* IE8 fix for window.hasOwnProperty - set to ignore error from jshint */ | |
/* jshint -W001 */ | |
$2.hasOwnProperty = $2.hasOwnProperty || Object.prototype.hasOwnProperty; | |
for ($1 in $2) { | |
if ($2.hasOwnProperty($1)) { | |
console.log($2[$1]$0); | |
} | |
} |
This file contains hidden or 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
diamond(width, dColor) | |
dWidth = unit(width, px) | |
display block | |
width dWidth; | |
height dWidth; | |
background dColor | |
position relative | |
top dWidth | |
transform rotate(-45deg) | |
transform-origin 0 100% |
This file contains hidden or 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
triangle(orientation, width, height, color) | |
if orientation == top | |
border-width 0 unit(width/2, px) unit(height, px) unit(width/2, px) | |
border-color transparent transparent color transparent | |
else if orientation == left | |
border-width unit(height/2, px) unit(width, px) unit(height/2, px) 0 | |
border-color transparent color transparent transparent | |
else if orientation == bottom | |
border-width unit(height, px) unit(width/2, px) 0 unit(width/2, px) | |
border-color color transparent transparent transparent |
This file contains hidden or 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
// http://www.mathsisfun.com/percentage-difference.html | |
// get percentage difference of 2 numbers | |
// returns optional unitType as well in the form of '%, px, em' etc | |
getPercentageDifference(v1, v2, unitType = '') | |
return unit(((v1 - v2) / ((v1 + v2) / 2)) * 100, unitType) | |
// get percentage difference of 2 numbers then returns the result minus a given max value | |
// returns optional unitType as well in the form of '%, px, em' etc | |
getPercentageDifferenceMinusMax(v1, v2, max, unitType = '') | |
return unit(max - getPercentageDifference(v1, v2), unitType) |
This file contains hidden or 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
var jqxhr = $.ajax({ | |
url: url, | |
type: 'GET', // default is GET but you can use other verbs based on your needs. | |
cache: true, // default is true, but false for dataType 'script' and 'jsonp', so set it on need basis. | |
data: {}, // add your request parameters in the data object. | |
dataType: 'json', // specify the dataType for future reference | |
jsonp: 'callback', // only specify this to match the name of callback parameter your API is expecting for JSONP requests. | |
statusCode: { // if you want to handle specific error codes, use the status code mapping settings. | |
404: handler404, | |
500: handler500 |