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
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// A Sass walk function, | |
// Calling a given function to each member of a list | |
// --- | |
// @param [list] $list: list to walk through | |
// @param [string] $function: function to apply to all members |
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
// ---- | |
// Sass (v3.3.7) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
//// Fibonacci Function | |
@function fibonacci($n) { | |
$fib: 0 1; | |
@for $i from 1 through nth($n,1) { | |
$new: nth($fib, length($fib)) + nth($fib, length($fib) - 1); |
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
/** | |
http://www.gianlucaguarini.com/blog/detecting-the-tap-event-on-a-mobile-touch-device-using-javascript/ | |
**/ | |
// jQuery | |
var getPointerEvent = function(event) { | |
return event.originalEvent.targetTouches ? event.originalEvent.targetTouches[0] : event; | |
}; | |
var $touchArea = $('#touchArea'), | |
touchStarted = false, // detect if a touch event is sarted |
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
// Grunt dynamic tasks examples | |
// Example 1 | |
https://oncletom.io/2013/dynamic-grunt-targets-using-templates/ | |
// Example 2 | |
// Call grunt release:target where target is the name of the subtask | |
grunt.registerTask('release', function(target) { | |
if (target === null) { | |
return grunt.warn("Build target must be specified, e.g. release:hover"); |
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
function clamp(val:Number, min:Number = MIN, max:Number = MAX){ | |
return Math.max(min, Math.min(max, 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
// Rounds a target number to a specific number of decimal places. | |
function roundToPrecision(numberVal:Number, precision:int = 0):Number | |
{ | |
var decimalPlaces:Number = Math.pow(10, precision); | |
return Math.round(decimalPlaces * numberVal) / decimalPlaces; | |
} |
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
// Linear interpolation | |
function interpolateVal(y0:Number, y1:Number, x:Number, x1:Number, x0:Number):Number | |
{ | |
//y = y0 + (x - x0) * (y1 - y0) / (x1 - x0); | |
return y0 + (x - x0) * (y1 - y0) / (x1 - x0); | |
} |
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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin keyframe ($animation_name) { | |
@-webkit-keyframes #{$animation_name} { | |
@content; | |
} | |
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
var timeoutId = 0; | |
$('#myElement').mousedown(function() { | |
timeoutId = setTimeout(myFunction, 1000); | |
}).bind('mouseup mouseleave', function() { | |
clearTimeout(timeoutId); | |
}); |
OlderNewer