Skip to content

Instantly share code, notes, and snippets.

View sleexyz's full-sized avatar

Sean Lee sleexyz

View GitHub Profile
@sleexyz
sleexyz / main.rs
Last active January 3, 2016 19:40
lisp interpreter
/// # Make-A-Lisp interpreter
extern crate rl_sys; // GNU readline bindings
extern crate regex;
use regex::Regex;
use std::str::FromStr;
use std::collections::HashMap;
@sleexyz
sleexyz / nixos_on_macbook.md
Last active February 4, 2025 18:06
Installing NixOS on a Macbook
@sleexyz
sleexyz / configuration.nix
Last active January 9, 2016 03:20
configuration.nix (works?)
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.extraModprobeConfig = ''
options hid_apple fnmode=2
@sleexyz
sleexyz / index.js
Created April 11, 2016 00:55
mfcc?
const WIDTH = window.innerWidth;
const HEIGHT = window.innerHeight;
let multiplied = false;
let canvas = document.getElementById("canvas");
canvas.width = WIDTH;
canvas.height = HEIGHT;
let canvasCtx = canvas.getContext("2d");
@sleexyz
sleexyz / live-code.md
Last active May 11, 2016 08:26
Context-Free live-coding

A Comparison of Interfaces: Programming Languages vs. Musical Instruments

As interfaces, musical instruments are simple at their individual components, yet are evidently capable of much improvisatory creative realtime expression by a human. On the other hand, progamming languages are complex interfaces that are infinitely more expressive when "integrated" over time, but regardless perhaps not as capable of realtime creative expression.

Is this a inevitable tradeoff?

As interfaces, how are instruments different from live-coding?

How can use these differences to make programming more expressive?

@sleexyz
sleexyz / qlcplus.nix
Last active May 21, 2016 07:23
kinda works now...! ( i didn't install phase, just make and make installed)
{ stdenv, fetchurl, pkgconfig, ccache, makeWrapper, qmake4Hook, qt4, libftdi1, alsaLib, libudev, libusb}:
stdenv.mkDerivation rec {
name = "qlcplus-${version}";
version = "4.10.3";
src = fetchurl {
url = "http://www.qlcplus.org/downloads/${version}/qlcplus_${version}.tar.gz";
sha256 = "1mrhlqvbgs8qnj7qik70a3gywvmck1malygqi0hm403j5w6f2bgb";
};
mutation is fast to write
immutable is slow to write, but in that way safer
@sleexyz
sleexyz / Fix.hs
Created June 23, 2016 19:29
Fixed point combinator derived without knot-tying, via recursive types
newtype Self t = Fold { unfold :: Self t -> t}
fix :: (a -> a) -> a
fix f = unroll . Fold $ f . unroll
unroll :: Self t -> t
unroll e = unfold e e
@sleexyz
sleexyz / AnnotatedFix.hs
Created June 23, 2016 19:32
Fixed point combinator derivied without knot-tying, via recursive types
{-# LANGUAGE GADTSyntax #-}
-- | Derivation of fix without general recursion
-- | Transliteration of PFPL 2nd Ed, pp. 180
module AnnotatedFix where
newtype Self t where
Fold :: (Self t -> t) -> Self t
s.options.numBuffers = 1024 * 16;
s.waitForBoot{
Routine{
include("SuperDirt");
2.wait;
SuperDirt.start;
}.play
}