Skip to content

Instantly share code, notes, and snippets.

View funrep's full-sized avatar

Karl-Oskar Rikås funrep

View GitHub Profile
Warning: pong.cabal: Unknown fields: exposed-modules (line 18)
Fields allowed in this section:
main-is, buildable, build-tools, cpp-options, cc-options,
ld-options, pkgconfig-depends, frameworks, c-sources,
default-language, other-languages, default-extensions,
other-extensions, extensions, extra-libraries, extra-lib-dirs,
includes, install-includes, include-dirs, hs-source-dirs,
other-modules, ghc-prof-options, ghc-shared-options, ghc-options,
hugs-options, nhc98-options, jhc-options
Resolving dependencies...
@funrep
funrep / .vimrc
Created October 5, 2013 11:11
my vim config
" My config
set nu
syntax on
au BufNewFile,BufRead *.clj set filetype=lisp
@funrep
funrep / monads.hs
Last active December 24, 2015 12:29
-- Attempt to implement monads
return' v = \_ -> v
lift a = a ()
bind a f = f $ lift a
inc n = n + 1
#lang racket
(define config
(hash "server" "irc.codetalk.io"
"port" 6667
"chan" "#lobby"
"nick" "tob"
"name" "tob the bot"))
(define (connect)
@funrep
funrep / ircbot.rkt
Last active December 24, 2015 09:49
#lang racket
(define config
(hash "server" "irc.codetalk.io"
"port" 6667
"chan" "#lobby"
"nick" "tob"
"name" "tob the bot"))
(define (connect)
@funrep
funrep / parse-irc.rkt
Created September 29, 2013 09:41
Racket regexp fails.
(define (parse s)
(regexp-match #rx"^(?:[:](\S+) )?(\S+)(?: (?!:)(.+?))?(?: [:](.+))?$" s))
; regexp code taken from here http://mybuddymichael.com/writings/a-regular-expression-for-irc-messages.html
@funrep
funrep / fib.hs
Created September 28, 2013 17:03
-- defines the fibonacci function, takes an integer and returns the fibonacci number
fib :: Int -> Int
fib n = if n <= 2 then
n
else fib (n - 1) + fib (n - 2)
-- define a infinit list of all fibonacci numbers
fibs :: [Int]
fibs = map fib [1..]
fibs = scanl (+) 0 $ 1 : fibs
main = print $ fibs !! 10
@funrep
funrep / log.txt
Created September 26, 2013 13:49
antibody missunderstanding
15:41 -!- Irssi: Starting query in QuakeNet with Antibody
15:41 <machinexon> sry if you got offended on forums, DID NOT mean that i had the impression samual
wwas the only one contributing atm, i meant i got that impression from his post,
and regarding the polish and design of the game, i have said it before but i do
like xonstats, a lot, it's really a great example of what programs that really
fits for the web
15:41 <machinexon> also your commentaries means a *lot*, they make it easier for people to dive into
the game, and you always point out non-obvious tactics players use and give some
tips yourself etc. which is really good for beginners
15:46 <machinexon> plz just respond nodnod or sth so i know you have read this when you have read this
@funrep
funrep / remove.sh
Created September 26, 2013 08:51
Ubuntu apt-get remove script
#!/bin/sh
# apt-get remove sucks, apt-get purge is good, but then running autoremove afterwards is annoying ;)
for args in $*;
do sudo apt-get purge $args && sudo apt-get --purge autoremove;
done