Skip to content

Instantly share code, notes, and snippets.

View silky's full-sized avatar

Noon van der Silk silky

View GitHub Profile
@silky
silky / serve.js
Created June 19, 2014 10:41 — forked from sordina/serve.js
#!/usr/bin/env node
// npm install connect
var port = process.argv[2];
var cwd = process.cwd();
if(! port) {
throw("Usage: serve <port>");
}
{-# LANGUAGE QuasiQuotes #-}
import Text.InterpolatedString.Perl6 -- For tests
import System.Environment (getArgs)
import Data.List.Split (splitOn)
import Data.List (intercalate)
-- IO:
main :: IO ()
In the Beginning was the Command Line
by Neal Stephenson
About twenty years ago Jobs and Wozniak, the founders of Apple, came up with the very strange idea of selling information processing machines for use in the home. The business took off, and its founders made a lot of money and received the credit they deserved for being daring visionaries. But around the same time, Bill Gates and Paul Allen came up with an idea even stranger and more fantastical: selling computer operating systems. This was much weirder than the idea of Jobs and Wozniak. A computer at least had some sort of physical reality to it. It came in a box, you could open it up and plug it in and watch lights blink. An operating system had no tangible incarnation at all. It arrived on a disk, of course, but the disk was, in effect, nothing more than the box that the OS came in. The product itself was a very long string of ones and zeroes that, when properly installed and coddled, gave you the ability to manipulate other very long strings of o
@silky
silky / notes.md
Last active November 7, 2023 12:32
notes (this is linked live on http://silky.github.io/)
@silky
silky / list.md
Last active August 29, 2015 14:05
impossible things

a list of things that are tentatively impossible.

  1. eat the sun
  2. disprove a true theorem
  3. walk through your desk in the next 5 minutes
  4. breathe in the vacuum of space
  5. purchase a quantum computer tomorrow
  6. ride a tiger to work
  7. drive a boat around the city instead of a car
  8. work with movie characters instead of real people
@silky
silky / ci
Created August 16, 2014 06:50 — forked from sordina/ci
#!/bin/bash
cabal init \
--version="0.1.0.0" \
--non-interactive \
--no-comments \
--minimal \
--license=MIT \
--author="Lyndon Maydwell" \
--email=maydwell@gmail.com \
@silky
silky / conj_monad.lhs
Last active August 29, 2015 14:06
tranducers
> {-# LANGUAGE RankNTypes,
> FlexibleInstances,
> UndecidableInstances #-}
> import Control.Monad (liftM2)
> type Reducer a r = r -> a -> r
> type Transducer a b = forall r. Reducer a r -> Reducer b r
@silky
silky / fixes.hs
Last active August 29, 2015 14:06
fix
-- what is this?
-- http://en.wikibooks.org/wiki/Haskell/Fix_and_recursion
fix :: (a -> a) -> a
fix f = f (fix f)
@silky
silky / ldp.hs
Last active August 29, 2015 14:07
lazy-dynamic-programming
-- see http://jelv.is/blog/Lazy-Dynamic-Programming/
import Data.Array (listArray, bounds, range, (!))
import Data.List (minimumBy)
import Data.Ord (comparing)
-- standard fib
fib n = fibs !! n
where fibs = 0 : 1 : zipWith (+) fibs (drop 1 fibs)