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
#!/bin/bash | |
echo 'digraph {' | |
data="$(grep '^data' Prototype.hs | sed 's/data //; s/ .*//')" | |
for i in $data | |
do | |
echo "$i;" | |
targets="$(grep "data $i .*=" Prototype.hs -A 6 \ | |
| sed '/^$/,$d' \ | |
| grep '::' \ |
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 component-clinic.core | |
" | |
PSA: Your components may be sick! | |
Make sure they are having regular checkups at the component-clinic! | |
> A small helper library to allow components to be made healthy. | |
> Useful for treating components that may become diseased on-the-fly. | |
> Initialize sickly components to facilitate crash-driven development. |
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 flojure | |
" | |
Functions relating to decision-tree type code. Allowing for debugging, logging, etc. | |
" | |
(:require [clojure.core.match :as m] | |
[pandect.core :as p])) | |
(defn truncate | |
[s n] | |
(subs s 0 (min (count s) n))) |
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
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.Text as T | |
import Graphics.Vty.Widgets.All | |
import Graphics.Vty.Input.Events | |
import Control.Monad | |
import Data.IORef | |
import System.Exit | |
import Control.Concurrent |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'cgi' | |
dom = Nokogiri::HTML.parse( open('http://www.imdb.com/chart/top') ) | |
titles = dom.css('.titleColumn a').map &:text |
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
-- Our Domain is always interpreted as (0 <= t <= 1) | |
import Data.Complex | |
type Coord = Complex Double | |
type FunT = Coord -> Coord | |
interpolate :: FunT -> FunT -> FunT |
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
{-# LANGUAGE QuasiQuotes #-} | |
import Data.Tree | |
import Data.Char | |
import Control.Arrow | |
import Text.RawString.QQ | |
import Test.QuickCheck | |
import Data.List.Split |
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 instap) | |
(defn text [l] (clojure.string/replace l #"^\s+" "")) | |
(assert (= (text " \t\t\t asdf") "asdf")) | |
(defn value [c] | |
(condp = c | |
\space 1 | |
\tab 4 | |
0 )) |
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
import Data.List | |
import Control.Lens | |
import Data.Bits.Lens | |
import Test.QuickCheck | |
pascal = iterate stepper firstrow | |
where | |
firstrow = [1] | |
stepper r = zipWith (+) ([0] ++ r) (r ++ [0]) |
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
{-# LANGUAGE OverloadedStrings #-} | |
-- http://cryptopals.com/sets/1/challenges/7/ | |
-- Second implementation without using AES library | |
-- http://en.wikipedia.org/wiki/Advanced_Encryption_Standard | |
import GHC.Word | |
import Data.Bits | |
import Data.Bits.Lens | |
import Data.List |