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
.parent { | |
overflow: hidden; | |
position: relative; | |
width: 100%; | |
} | |
.child { | |
height: 100%; | |
position: absolute; | |
right: 0; |
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
/** | |
* JavaScript function to output first 40 Fibonacci and convergence to Pi | |
*/ | |
for (var p = 1, q = 1, t, i = 1; i < 41; i++) { | |
console.log('Fibonacci[%d] (%d + %d): %d; Pi: %f', i, p, q, q, (q/p)); | |
t = q; | |
q = p + q; | |
p = t; | |
} |
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 the URL hash in the format '#debug-ddmmyyyy' to set a global | |
* variable __DEBUG__ so that it can be used across all scritps to | |
* do console outputs, legacy alerts, etc. | |
*/ | |
var __DEBUG__ = (function() { | |
var pad = function (s) {return (s.length == 1 ? '0' + s : s)}, // to pad numbers with leading 0s | |
t = new Date(), | |
y = t.getFullYear().toString(), | |
m = pad((t.getMonth() + 1).toString()), // month is index returned in JS :) |
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
/** | |
* IE5.x | |
*/ | |
property/**/:/**/value; | |
/** | |
* IE6 and below | |
*/ | |
_property: value; | |
-property: value; |
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 global = window; // window for browser environments | |
for (var prop in global) { | |
if (Object.prototype.toString.call(global[prop]) === '[object Array]') { // check for array | |
if (prop !== 'undefined') { | |
console.log(prop); | |
} | |
} | |
} |