Skip to content

Instantly share code, notes, and snippets.

View Tarrasch's full-sized avatar
💭
I may be slow to respond.

Arash Rouhani Tarrasch

💭
I may be slow to respond.
View GitHub Profile
module Modulo where
data Expr =
V Integer
| Plus Expr Expr
| Mult Expr Expr
deriving (Eq, Show)
instance Num Expr where
(+) = Plus

Hong

This is a pong clone written in haskell.

Installing and Running

  1. First get the [Haskell Platform][hp].

  2. Clone the project

@Tarrasch
Tarrasch / gist:1419145
Created December 1, 2011 19:22
Makar's Violin
Makar's Violin
The Legend of Zelda: The Wind Waker
Composed by Koji Kondo
Tabbed by Richard Schaefer ([email protected])
8/8/06
e----------0-------0---------------------0----------------
B----1-------1-1-3---3-------1-3-1---------1-1-------1----
G--0---0-0-------------2-0-2-------2-0-2-------2-0-2---0-0
D---------------------------------------------------------
@Tarrasch
Tarrasch / gist:1427855
Created December 3, 2011 19:06
Saria's Song
(not my work!!! /Arash)
I usually use -# for drawing in air
Sarias song
-5 -6 -7 -5 -6 -7
-5 -6 -7 8 -8 -7 7 -7 6 5 -4 5 6 5
@Tarrasch
Tarrasch / gist:1463218
Created December 11, 2011 22:38 — forked from oleander/gist:1460141
Water-möte 2011/12/15

Water-möte 2011/12/15

På agendan

  • Projektnamn, är Water ett bra namn?
  • Vart ska projektet hostas?
  • Finansiellt stöd för servrar och kodhosting
  • Tidigare brainstorming - bilder
  • Material att kolla på under lovet
name: Tiny
version: 0.0.0
license: BSD3
license-file: LICENSE
author: Arash
maintainer: Arash
synopsis: The greatest Yesod web application ever.
description: I'm sure you can say something clever here if you try.
category: Web
stability: Experimental
@Tarrasch
Tarrasch / idea.md
Created January 15, 2012 18:25
idea of hackage package

Hello, I'm thinking of creating a package for hackage. I need it myself in a project. First I just implemented it in my own project, but now I want to give back to the community by publishing the reuseable parts in tidy package.

The package is best described by my application specific [code], it's basically a helper function creating an IORef a thats updated say every hour. For example scraping a site. So given an action IO a, run it every hour and save the result in the IORef a, if the provided action crashes, then the parent thread shouldn't crash, instead it should just re-run the action the next hour. The application in mind is indeed for scraping.

I've got two questions about this:

  1. Is something like this already done? I've not found it anywhere.

  2. Where in the module hierarchy does this fit? Control.Concurrent.Helpers.TimedRepeating or System.IO.TimedRepeating? Any better name idea than TimedRepeating?

@Tarrasch
Tarrasch / timejournal.rb
Created January 30, 2012 21:30
Script of regexping how much I worked from journal input
#!/usr/bin/ruby
r = /\*\*[\d :\-]+\*\*/
s = $stdin.readlines.join
ms = s.scan r
class Interval
attr_accessor :time0, :time1
def initialize(s)
r = /[*:-]/
@Tarrasch
Tarrasch / StrictFoldr.hs
Created February 7, 2012 13:51
Strict foldr function
module StrictFoldr where
-- A deep strict foldr, very memory inefficient
dsFoldr :: (a -> b -> b) -> b -> [a] -> b
dsFoldr f z [] = z
dsFoldr f z (x:xs) = seq below $ f x $ below
where below = dsFoldr f z xs
-- The lazy value will be `"abc" ++ undefined` whilst the strict will be just `undefined`
valueLazy, valueStrict :: String
@Tarrasch
Tarrasch / gist:1886155
Created February 22, 2012 17:19
error message
1) CommitRequest validation validates a commitrequest
Failure/Error: @labgroup = create(:lab_group)
NoMethodError:
undefined method `identification=' for #<LabGroup:0xaa4cbbc>
# ./spec/models/commit_request_spec.rb:43:in `block (2 levels) in <top (required)>'