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
require 'cgi' | |
require 'jekyll' | |
require 'redcarpet' | |
class RedcarpetCodeMirror < Redcarpet::Render::HTML | |
def initialize | |
super | |
@total = 0 | |
end |
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
export let x = 1; | |
export function inc() { | |
x++; | |
}; |
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([ | |
[{path: "/", component: App}, | |
[{path: "about", component: About}], | |
[{path: "users", component: Users}, | |
[{path: "/user/:userId", component: User}] | |
], | |
[{path: "*", component: NoMatch}] | |
] | |
], document.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
### 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 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 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 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 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 default [ | |
"module1", | |
"module2" | |
].map(x => System.import(x)).then(([ | |
module1, | |
module2 | |
])) => { | |
return { | |
myApi: whatever | |
}; |
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 fly(creature) { | |
return ( | |
"The " + creature.species + | |
" flies using its " + creature.methodOfFlight | |
); | |
} | |
function hunt(creature, otherCreature) { | |
return ( | |
"The " + creature.species + |
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 util = require("util"); | |
var P = require("parsimmon"); | |
// Throw away whitespace surrounding a string. | |
function operator(s) { | |
return P.optWhitespace | |
.then(P.string(s)) | |
.skip(P.optWhitespace); | |
} |