Skip to content

Instantly share code, notes, and snippets.

View wavebeem's full-sized avatar

Sage Fennel wavebeem

View GitHub Profile
require 'cgi'
require 'jekyll'
require 'redcarpet'
class RedcarpetCodeMirror < Redcarpet::Render::HTML
def initialize
super
@total = 0
end
@wavebeem
wavebeem / foo.js
Created November 13, 2015 16:11
ES6 modules export bindings, not values.
export let x = 1;
export function inc() {
x++;
};
render([
[{path: "/", component: App},
[{path: "about", component: About}],
[{path: "users", component: Users},
[{path: "/user/:userId", component: User}]
],
[{path: "*", component: NoMatch}]
]
], document.body);
@wavebeem
wavebeem / current.sqg.rb
Last active December 2, 2015 00:10
This Gist shows the current syntax of the Squiggle programming language, along with other ideas about how the syntax could look.
### 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]]]
### 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]]]
### 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]]]
setTimeout () ->
console.log("Hello!")
, 300
export default [
"module1",
"module2"
].map(x => System.import(x)).then(([
module1,
module2
])) => {
return {
myApi: whatever
};
function fly(creature) {
return (
"The " + creature.species +
" flies using its " + creature.methodOfFlight
);
}
function hunt(creature, otherCreature) {
return (
"The " + creature.species +
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);
}