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
// finds an image path in the string returned from elem.style.backgroundImage | |
var = rgx = /(?:url\(['"]?)(\w[a-z-.\/]+)(?:['"]?\))/g; |
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
// Calculate px and rem font-sizes | |
// - assumes html { font-size: 10px; } | |
@mixin font-size( $size ) { | |
$pixels: #{$size}px; | |
$rems: #{$size/10}rem; | |
font-size: $pixels; | |
font-size: $rems; | |
} |
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
/* | |
* @param: name - String, a label for the test - usually the function's name | |
* @param: operation - Function, the code to test | |
*/ | |
var profile = function ( name, operation ) { | |
var iterate = function ( operation ) { | |
var start = new Date().getTime(); | |
var elapsed = 0; | |
for( var itrs = 0; elapsed < 1000; itrs++ ) { |
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 isSimilar( o1, o2 ) { | |
var similar = true, | |
prop = null; | |
for( prop in o1 ) { | |
if ( o1.hasOwnProperty( prop ) ) { | |
similar &= ( o2.hasOwnProperty( prop ) && o1[prop] === o2[prop] ); | |
} else { | |
return false; | |
} | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.5"> | |
<title>submit button touch area test</title> | |
</head> | |
<body> |
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
/* ==================== | |
Render | |
String builders for | |
- elements | |
- their attributes | |
======================*/ | |
Render = 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
function debug(msg) { | |
var container = document.getElementsByTagName('body')[0], | |
bug = document.createElement('div'), | |
bugStyle = bug.style, | |
bugSplat; | |
console.log('msg'); | |
bugStyle.position = 'absolute'; | |
bugStyle.top = '50%'; |
NewerOlder