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
/* | |
StackBlur - a fast almost Gaussian Blur For Canvas | |
Version: 0.5 | |
Author: Mario Klingemann | |
Contact: [email protected] | |
Website: http://www.quasimondo.com/StackBlurForCanvas | |
Twitter: @quasimondo |
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
/** | |
* jQuery.support.cssProperty | |
* To verify that a CSS property is supported (or any of its browser-specific implementations) | |
* | |
* @param string p - css property name | |
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator | |
* | |
* @Author: Axel Jack Fuchs (Cologne, Germany) | |
* @Date: 08-29-2010 18:43 | |
* |
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
<div class="slider-wrap"> | |
<div class="slider" id="slider"> | |
<div class="holder"> | |
<div class="slide" id="slide-0"><span class="temp">74°</span></div> | |
<div class="slide" id="slide-1"><span class="temp">64°</span></div> | |
<div class="slide" id="slide-2"><span class="temp">82°</span></div> | |
</div> | |
</div> | |
<nav class="slider-nav"> | |
<a href="#slide-0" class="active">Slide 0</a> |
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 number from string type to number type | |
// It's a shallow convertion only 1 level deep | |
// param {object|array|string|number} o variable to be converted | |
// return {object|array|string|number} converted variable | |
function numberize(o) { | |
if (typeof o === "string" || typeof o === "number") { | |
if (!isNaN(o)) { | |
o = parseFloat(o); | |
} | |
} else if (Object.prototype.toString.call(o) === '[object Array]') { |
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
/* | |
Calculate FV. | |
Exact same Excel FV function | |
Rate is the interest rate per period. | |
Nper is the total number of payment periods in an annuity. | |
Pmt is the payment made each period; it cannot change over the life of the annuity. Pmt must be entered as a negative number. | |
Pv is the present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero). PV must be entered as a negative number. | |
Type is the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0 which represents at the end of the period. If payments are due at the beginning of the period, type should be 1. | |
*/ |
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
<h3>expand content with css3</h3> | |
<div class="content"> | |
<ol> | |
<li>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</li> | |
<li>Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</li> | |
<li>Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi.</li> | |
<li>Pellentesque fermentum dolor. Aliquam quam lectus, facilisis auctor, ultrices ut, elementum vulputate, nunc.</li> | |
<li>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</li> | |
<li>Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliqua |
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
// Source: http://eightmedia.github.io/hammer.js/examples/carousel.html | |
/** | |
* requestAnimationFrame and cancel polyfill | |
*/ | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelAnimationFrame = |
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
sudo iptables -t nat -A PREROUTING -p tcp -port 80 -j REDIRECT --to-ports 3000 |
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 obj = { | |
x : 5, | |
y : 10 | |
}; | |
// defineProperty doesn't work on IE < 9, IE8 only when it's a DOM element | |
Object.defineProperty(obj, 'sum', { | |
get: function(){ | |
return this.x + this.y | |
} |
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
/* | |
author: Lance Vo | |
License: MIT | |
autoHeight directive | |
-------------------- | |
it calculates the remaining height (px) after substracting header/footer/offset. | |
Useful for responsive design content. | |
examples: |