Skip to content

Instantly share code, notes, and snippets.

View louissalin's full-sized avatar

Louis Salin louissalin

View GitHub Profile

the code that fails is below. Here's some imported code:

newtype Size = Size Int
  deriving (Eq, Ord, Show, Num)

getSize :: Size -> Int
getSize (Size i) = i
@louissalin
louissalin / gist:479093b5e3a34248b09a
Created June 4, 2014 00:09
Active Record code that may or may not work
require 'sinatra'
require 'active_record'
require 'sqlite3'
require 'json'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => 'app.db'
)
@louissalin
louissalin / gist:41d05e98509998cc21e7
Last active August 29, 2015 14:01
Praask's last letter
Dear mother,
If you read this letter then I have unfortunately died. Don't believe everything you read about me,
as I'm sure not all of it is true. You knew it already; I love guns. This love is what killed me.
I dared venture out into the unknown and I guess I didn't make it back.
Ever since the day my brother was killed by a better fighter, I vowed to avenge his death. Weapons
are the best way to outmatch an opponent. They are the great equalizer. A Wookie can fall to a pistol
blast. My brother could've been saved had he carried a weapon. Fists and claws are nothing. All that
matters is the concentration of energy that is expelled from the tip of a riffle. I have spent my
@louissalin
louissalin / gist:6486d2b9fe950a068e20
Created May 8, 2014 20:21
A test of adding validations to a domain model
import scalaz._
import Scalaz._
class InvoiceValidations {
def checkName(name: String): ValidationNel[String, String] = {
if (name.length > 100)
"name too long".failNel[String]
else
name.successNel[String]
}