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 n = new Number(x); // where x is a global storing an incrementer | |
function doMath(a){ | |
if (typeof a == "number") { | |
return a + x; | |
} | |
} | |
doMath(n); |
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
// Date -> Number: | |
var d = +(new Date()); | |
// 1281743590756 | |
typeof d; | |
// number | |
// almost anything -> String | |
d += ''; | |
// '1281743590756' | |
typeof d; |
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
jsc make-some-arrays.js | |
test #6: | |
total time: 0.405 seconds | |
test #7: | |
total time: 0.892 seconds |
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
.my-class { | |
/* fallback for browsers that do not support CSS3 */ | |
background: #222; | |
/* -moz requires "px" or % after the stop # */ | |
background: -moz-linear-gradient(top, #666, #222 32px); | |
/* -webkit does not require "px" after the stop $ */ | |
background: -webkit-gradient(linear, 0 0, 0 32, from(#666), to(#222)); | |
} |
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
article { | |
$base_font_size: 12px; | |
$base_line_height: $base_font_size * 1.5; | |
font-size: $base_font_size; | |
line-height: $base_line_height; | |
/* simple math */ | |
h1 { font-size: $base_font_size * ($base_line_height + 1); } | |
h2 { font-size: $base_font_size + 4px; } |
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
class Dehyphenator { | |
static String getActionName(String hyphenatedUrl) { | |
return hyphenatedUrl?.replaceAll("-.", { it[1].capitalize() } ) | |
} | |
} |
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 __T = null, | |
__O = { | |
b: { | |
j: { | |
fn: function(){ | |
// just so that we're performing *some* operation | |
var _2 = 1 + 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
[1] == [1]; | |
// false | |
[1] == 1; | |
// true | |
[1] === 1; | |
// false | |
[1] == '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
var arr = [10, 5, 6, 1, -2, 28]; | |
function ascending(a, b){ | |
return ( (a - b) / Math.abs(a - b) ) || 0; | |
} | |
function descending(a, b){ | |
return ( (b - a) / Math.abs(b - a) ) || 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
#!/bin/sh | |
echo "Initializing style.css with license text..." | |
touch style.css | |
cat _license.txt > style.css | |
echo "Compiling Sass to style.css..." | |
# note that omitting the [OUTPUT] param writes to stout | |
sass --style compressed src/scss/style.scss >> style.css |
OlderNewer