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
| setTimeout () -> | |
| console.log("Hello!") | |
| , 300 |
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
| ### Imports | |
| let {JSON, document, console} = global | |
| ### Basic data | |
| let namedConstants = [true, false, null, undefined] | |
| let numbers = [1, 2, 1_000, 3.14, NaN, -Infinity] | |
| let strings = ["hello,\n", "\u{20}", "\"world\"\u{2757}"] | |
| let arrays = [[], [1, 2], [3, [[4]], [5]]] |
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
| ### Imports | |
| let {JSON, document, console} = global | |
| ### Basic data | |
| let namedConstants = [true, false, null, undefined] | |
| let numbers = [1, 2, 1_000, 3.14, NaN, -Infinity] | |
| let strings = ["hello,\n", "\u{20}", "\"world\"\u{2757}"] | |
| let arrays = [[], [1, 2], [3, [[4]], [5]]] |
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
| ### Imports | |
| let {JSON, document, console} = global | |
| ### Basic data | |
| let namedConstants = [true, false, null, undefined] | |
| let numbers = [1, 2, 1_000, 3.14, NaN, -Infinity] | |
| let strings = ["hello,\n", "\u{20}", "\"world\"\u{2757}"] | |
| let arrays = [[], [1, 2], [3, [[4]], [5]]] |
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
| render([ | |
| [{path: "/", component: App}, | |
| [{path: "about", component: About}], | |
| [{path: "users", component: Users}, | |
| [{path: "/user/:userId", component: User}] | |
| ], | |
| [{path: "*", component: NoMatch}] | |
| ] | |
| ], document.body); |
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
| export let x = 1; | |
| export function inc() { | |
| x++; | |
| }; |
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
| require 'cgi' | |
| require 'jekyll' | |
| require 'redcarpet' | |
| class RedcarpetCodeMirror < Redcarpet::Render::HTML | |
| def initialize | |
| super | |
| @total = 0 | |
| end |
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
| # Good use of match | |
| def compile(node) = | |
| match node | |
| case {type: "Add", a, b} => | |
| ["+", compile(a), compile(b)] | |
| case {type: "If", condition, result, alternative} => | |
| ["if", compile(condition), compile(result), compile(alternative)] | |
| # Bad use of match | |
| def greet(person) = |
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
| def start() = | |
| let body = document.body | |
| let root = React.createElement(GameView) | |
| let container = document.getElementById("react-container") | |
| let thing = React.render(root, container) | |
| in do | |
| set(app, "root", thing); | |
| body.addEventListener("click", focusClickhole); | |
| tick(); | |
| end |
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
| "use strict"; | |
| const util = require("util"); | |
| const P = require("parsimmon"); | |
| console.log(Date() + "\n"); | |
| const _ = P.optWhitespace; | |
| const tag = name => rest => |