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
import Diagrams.AST | |
main = outputImage "hilbert.png" w w (hilbert i) where (i,w) = (8,1200) | |
hilbert i = Modifier (LineWidth 0.1) $ Shape $ Path Open $ Offsets (iterate build base !! i) | |
base = [(0,1),(1,0),(0,-1)] | |
build x = l $ n x ++ o ++ r (r (l (x ++ o ++ x) ++ o ++ n x)) |
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
import Data.Monoid | |
import Data.List | |
import Graphics.Gloss hiding (Vector, scale) | |
-- Rendering | |
main = animateInWindow "Gravity" (1000,700) (0,0) black (Pictures . map picture . (progression !!) . round . (*40)) |
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
import Data.List | |
import Control.Arrow | |
import System.Random | |
-- Core Life Engine | |
life = f 3 >>> map (map (q 3 >>> uncurry s)) | |
s n 1 | n < 3 = 0 -- There is no 'off-by-one' error here |
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
{-# Language OverloadedStrings #-} | |
import qualified Data.ByteString.Char8 as BC | |
import qualified Data.ByteString as B | |
import qualified Data.Conduit.Binary as CB | |
import qualified Data.Conduit.List as CL | |
import qualified Data.Map as M | |
import qualified Data.IORef as R | |
import Data.Conduit.Network | |
import Data.Conduit |
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
import Data.List | |
import Data.Ord | |
class (Ord t, Num t) => Windowed a t | a -> t where | |
windowTag :: a -> t | |
dataTag :: a -> t | |
type SB a = (a -> a -> Ordering) -> [a] -> [a] | |
insertionSortBy cmp = foldr (insertBy cmp) [] |
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
{-# LANGUAGE NoMonomorphismRestriction #-} | |
import Network.HTTP.Conduit | |
import Text.XML.HXT.Core | |
import Data.ByteString.Lazy.Char8 (unpack) | |
import System.IO | |
main = prog 0 [] | |
prog offset lastItems = do |
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
{-# LANGUAGE OverloadedStrings #-} | |
-- http://www.yesodweb.com/book/xml | |
import Text.XML | |
import Text.XML.Cursor | |
import Network.HTTP.Conduit | |
main = do | |
cursor <- fmap fromDocument prog |
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
module HTML2XML where | |
import Control.Monad | |
import Control.Monad.Identity | |
import Text.HTML.TagSoup | |
import Text.StringLike | |
import qualified Control.Monad.Trans.State.Lazy as State | |
data CloseState a = CloseState {incomming :: a, open :: a, result :: a} |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="sordina" # "sunaku" # "alanpeabody" "dpoggi" # random robbyrussell sunrise afowler dpoggi | |
# muse.zsh-theme |
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
[user] | |
name = <name> | |
email = <email | |
[color] | |
diff = always | |
[alias] | |
st = status | |
ci = commit |