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
| testml = require("../lib/testml") | |
| class TestMLBridge | |
| uppercase: (s) -> | |
| s.to-upper-case! | |
| lowercase: (s) -> | |
| s.to-lower-case! | |
| combine: (...args) -> |
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
| ; An exploration into Conway's Game of Life, in Clojure. | |
| ; Based on the work of Chas Emerick, Brian Carper and Christophe Grand, in the book | |
| ; _Clojure Programming_. | |
| ; | |
| ; There are three implementations of the stepping function here: | |
| ; - indexed-step, which handles the algorithm much like I have in other languages. | |
| ; - indexed-functional-step, which removes the loops and instead operates with reduces | |
| ; - functional-step, a method that removes the need for indexes by using the properties of sequences | |
| ; - pure-step, an elegant and tiny redesign of the idea. | |
| (defn empty-board |
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
| (defn wilson-maze | |
| "Returns a random maze carved out of walls; walls is a set of | |
| two-item sets, #{a b}, where a and b are locations. The returned | |
| maze is a set of the remaining walls." | |
| [walls] | |
| (let [paths (reduce | |
| (fn [index [a b]] (merge-with into index {a [b] b [a]})) | |
| {} (map seq walls)) | |
| start-loc (rand-nth (keys paths))] | |
| (loop [walls walls |
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 express = require('express') | |
| var port = process.env.PORT || 5000; | |
| var app = express(); | |
| app.use(express.logger()); | |
| app.get('/', function (req, res) { | |
| res.send("Hello world, from Java`Script."); | |
| }); |
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
| (ns overtone-tutorial.second-song | |
| (:use overtone.live | |
| overtone.inst.drum)) | |
| (def metro (metronome 120)) | |
| (definst saw-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4] | |
| (* (env-gen (lin-env attack sustain release) 1 1 0 1 FREE) | |
| (saw freq) | |
| vol)) |
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
| global <<< require \prelude-ls | |
| fs = require \fs | |
| yaml = require \js-yaml | |
| marked = require \marked | |
| hljs = require \highlight.js | |
| jade = require \jade | |
| marked.setOptions {highlight: (lang, code) -> | |
| hljs.highlightAuto(lang, code).value | |
| } |
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 v6; | |
| use lib 'lib'; | |
| use Test; |
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
| subtest { | |
| ok 1 + 1 eq 2, "Reality sinks in; this isn't a dream."; | |
| is 123.WHAT.gist, "(Int)", "Integers are treated as _scalar Int objects_"; | |
| is 1.23.WHAT.gist, "(Rat)" "Rationals are treated as _scalar Rat objects_"; | |
| is "moo".WHAT.gist, "(Str)", "Strings are treated as _scalar Str objects_"; | |
| is [1, 2, 3].WHAT.gist, "(Array)", "Arrays, or Lists, are treated as _Array objects_"; | |
| is {'name' => 'Camelia'}.WHAT.gist, "(Hash)", "Hashes, or hash-maps, are treated as _Hash objects_"; | |
| }, "Yeah... I've suspended disbelief for the narrative; I'm stranded."; |
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
| The game is on; your first clue has two parts: | |
| the monitor you gave | |
| https://goo.gl/3NCcdL |
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 AppState { | |
| @observable raw_ticket_data; | |
| @observable sort_by = 'Owner'; | |
| @observable group_by = 'Queue'; | |
| constructor(raw_ticket_data) { | |
| this.raw_ticket_data = raw_ticket_data; |