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
vendor | |
.bundle |
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
<template> | |
<div class="synth"> | |
<div class="synth__settings"> | |
<div v-for="(controls, category) of settings"> | |
<h2>{{category}}</h2> | |
<ul> | |
<li v-for="(value, label) of controls"> | |
<label>{{label}}</label> | |
<input type="text" @input="updateSetting(category, label, $event)" v-model="settings[category][label]"> | |
<!-- {group: "{{category}}", name: "{{label}}", default: {{JSON.stringify(value)}}, min: {{Number.MIN_VALUE}}, max: Infinity}, --> |
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
(ns grime.core | |
(:require [grime.state :as st :refer [run-state state >> >>=]])) | |
(def world-state | |
{:last-entity-id -1 | |
:entities {}}) | |
(defn mutate [entity f & args] | |
(state | |
(fn [world] |
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 PDFDocument = require('pdfkit'); | |
var fs=require('fs'); | |
var process = require('process') | |
var captureText = function(cb) { | |
var text = "" | |
process.stdin.on('readable', () => { | |
chunk = process.stdin.read(); | |
if(chunk) text = text + chunk; | |
}); |
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
(ns markov.experiment | |
(:require [clojure.string :as string])) | |
(defn wrand [m] | |
(let [total (reduce + (vals m)) | |
r (rand total)] | |
(loop [ks (keys m) sum 0] | |
(if (< r (+ (get m (first ks)) | |
sum)) | |
(first ks) |
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
{- rps.hs Simple Rock Paper Scissors written in Haskell | |
- for translation to Ocaml as a learning exercise. | |
-} | |
data Move = Rock | Paper | Scissors deriving (Show, Eq) | |
data Player = Player String deriving (Show, Eq) | |
data Outcome = Winner Player | Tie deriving (Show, Eq) |
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
{ | |
"Alabama":{ | |
"name":"Alabama", | |
"borders":[ | |
"Mississippi", | |
"Tennessee", | |
"Georgia", | |
"Florida" | |
] | |
}, |
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
/* | |
* robotNav.js | |
* | |
* The green key is located in a slightly more | |
* complicated room. You'll need to get the robot | |
* past these obstacles. | |
*/ | |
function startLevel(map) { | |
// Hint: you can press R or 5 to "rest" and not move the |
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 notes, on, off; | |
MIDIClient.init; | |
MIDIIn.connect(); | |
SynthDef.new(\MonoSaw, { | |
|freq = 440, amp = 0.2, | |
dur = 1, gate = 0, |
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
enum Operation { | |
Add, | |
Sub, | |
Mul, | |
Div, | |
Exp | |
} | |
impl Operation { | |
fn apply(self, a : int, b : int) -> int { |
NewerOlder