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
{ | |
"tag": "div", | |
"attrs": { | |
"className": "sale sale-tile sale-3325 date-2014-08-08-sale-3325 draft no-pricing", | |
"data-sale-day": "2014-08-08", | |
"data-sale-id": 3325, | |
"draggable": "true" | |
}, | |
"children": [ | |
{ |
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
Mithril = m = new function app(window) { | |
var type = {}.toString | |
var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g, attrParser = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/ | |
function m() { | |
var args = arguments | |
var hasAttrs = type.call(args[1]) == "[object Object]" && !("tag" in args[1]) && !("subtree" in args[1]) | |
var attrs = hasAttrs ? args[1] : {} | |
var classAttrName = "class" in attrs ? "class" : "className" | |
var cell = {tag: "div", attrs: {}} |
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 fnArr: (()->())[] = [] | |
fnArr.append({ println("a") }) | |
fnArr.append({ println("b") }) | |
fnArr.append({ println("c") }) | |
for fn in fnArr { fn() } | |
// a | |
// b | |
// c |
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
// 375 loops per second | |
// – Arduino Uno R3 - | |
// Thanks to FastLED Math library: | |
// https://github.com/FastLED/FastLED/wiki/High-performance-math | |
void sinePixels() { | |
uint8_t timeScale = 20; | |
long time = millis() * timeScale; | |
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
<cfsavecontent variable="input"> | |
<cfinclude template="request.xml"> | |
</cfsavecontent> |
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
function yell(n){ | |
if (n > 0) { | |
return yell(n-1) + "a"; | |
} else { | |
return "hiy"; | |
} | |
} |
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
function test(email, name) { | |
if (email == "" || name == "") { | |
alert("Enter mail or name"); | |
} | |
return false; | |
if (email.indexOf("@") == -1) { | |
alert("Bad email"); | |
} |
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
» curl -I http://www.yuzustudios.com/gallery/Food/G0000zhbdZAbEpkQ/C0000TRldtyo7j4w | |
HTTP/1.1 301 Moved Permanently | |
Date: Sun, 28 Apr 2013 20:24:31 GMT | |
Server: Apache | |
Location: http://yuzu.photoshelter.com/gallery/Food/G0000zhbdZAbEpkQ/C0000TRldtyo7j4w | |
Vary: Accept-Encoding | |
Content-Type: text/html |
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
> Counter | |
function Counter() { [native code] } | |
> Counter() | |
TypeError: Illegal constructor | |
> c = new Counter() | |
TypeError: Illegal constructor | |
> Counter(1) |