Skip to content

Instantly share code, notes, and snippets.

Avatar

Justus Sagemüller leftaroundabout

  • Høgskulen på Vestlandet
  • Bergen
View GitHub Profile
@leftaroundabout
leftaroundabout / ghc-pkg_list
Created Jul 20, 2014
My `ghc-pkg list` as of now.
View ghc-pkg_list
/usr/local/haskell/lib/ghc-7.8.2/package.conf.d:
Cabal-1.18.1.3
array-0.5.0.0
base-4.7.0.0
bin-package-db-0.0.0.0
binary-0.7.1.0
rts-1.0
bytestring-0.10.4.0
containers-0.5.5.1
deepseq-1.3.0.2
@leftaroundabout
leftaroundabout / diagrams-gtk-example.hs
Created Oct 9, 2014
Simple example of rendering diagrams to a GTK window. Being an updated version of https://groups.google.com/forum/#!topic/diagrams-discuss/IWSGyN--AlM
View diagrams-gtk-example.hs
{-# LANGUAGE NoMonomorphismRestriction #-}
{- | A first example of drawing diagrams from within GTK. This
program draws a Koch snowflake with the depth controllable
via a GTK widget.
-}
module Main where
import Graphics.UI.Gtk
import Diagrams.Prelude
@leftaroundabout
leftaroundabout / edit-html-cb
Created May 31, 2015
Edit a gtk-clipboard “in-place”.
View edit-html-cb
#!/usr/bin/env python
import gtk
import chardet
import os
import getopt
import subprocess
dtype = 'text/html'
htmlclip = gtk.Clipboard().wait_for_contents(dtype).data
encoding = chardet.detect(htmlclip)['encoding']
@leftaroundabout
leftaroundabout / 31-edo.scl
Created Jul 8, 2015
The Huygens tuning 31-edo, specified by a Scala .scl file
View 31-edo.scl
!
31
!
38.70967741935481
77.41935483870962
116.12903225806443
154.83870967741925
193.54838709677406
232.25806451612885
View TreeInsert.hs-core
TreeInsert.$wtreeInsert =
\ (@ a_arS)
(w_sYW :: GHC.Classes.Ord a_arS)
(w1_sYX :: a_arS)
(w2_sYY :: TreeInsert.Tree a_arS) ->
case w2_sYY of _ [Occ=Dead] {
TreeInsert.EmptyTree ->
(# w1_sYX,
TreeInsert.EmptyTree @ a_arS,
TreeInsert.EmptyTree @ a_arS #);
@leftaroundabout
leftaroundabout / hs-golf-turca.hs
Last active Dec 16, 2015
Tiny piano – Rondo Alla Turca
View hs-golf-turca.hs
import Control.Parallel
main = mapM_ (\(d,s)->(\p->p>>p>>p>>p).putChar.toEnum.round.(+d).(*62).min 2.abs$s+1).zip(dθ 1).lim.rev.hgp 9. render 9e6 (\_->0) . Sequence[]
$[mT%8.1,t2%16.1,t3(7)%8,t4%8,t5%16,t3(7)%8,mT%8.1,t2%16.1,t3(tev arp8)%8,cdT%99] >>= \e->[e,e]
mM=Sequence[][2-^8,1-^8,0-^8,1-^8,3-^4]
cM=Sequence[][7-^20,8-^20,9.^4,Sequence[(7,0),(6,1)](map((2).(.^4))[6,5,6])%0.75]
cMv=Sequence[][10-^2,8.^4,9.^4,hom(.^4)[[24,5],[23,8,12],[22,4],[21,6,9],[22,3],[19,5,8],[20,4],[18,6,9],[17]]#7&(-14)%2.5,tr 2%0.4,1-^9,2-^12,1-^1]%4.5
(Sequence[][6-^4,lp(8.^43)%(3/4),sil%2,lp(5.^43)%h,lp(5.^42)%h,1-^17]&(-14)#7#4%5)
mMa f=Sequence[][(1-3*f).^4,lp(5.^4(-2-f))%0.75,mMa f%1.5,mMa(f*2)%h,mMa f%1]#7
@leftaroundabout
leftaroundabout / PiMelody.hs
Last active Dec 23, 2015
An automatic accompaniment generator for infinite melodies, applied to a simple mapping of the decimal digits of π to an A–harmonic-minor scale.
View PiMelody.hs
module PiMelody where
import Data.List
data MelodyNote = Gs | A | B | C' | D' | E' | F' | Gs' | A' | B'
deriving (Eq, Show, Enum)
type Melody = [MelodyNote] -- Assume simple all-quavers rythm.
piMelody :: Melody
View git-tmp-commit.py
#!/usr/bin/env python2
import subprocess
import sys
import datetime
import re
if __name__ == "__main__":
t = datetime.datetime.now()
branchn = subprocess.check_output([ 'git'
@leftaroundabout
leftaroundabout / downloadfail.ipynb
Created Jul 17, 2016
Linker error when using download in IHaskell
View downloadfail.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View PlanckDice.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.