Skip to content

Instantly share code, notes, and snippets.

View Voker57's full-sized avatar

Voker57 Voker57

View GitHub Profile
#!/bin/bash
gem1.8 list --local --no-versions > 1.8.txt
gem1.9 list --local --no-versions > 1.9.txt
diff gem1.8.txt gem1.9.txt
import Data.List
toBool 0 = False
toBool 1 = True
fromBool True = 1
fromBool False = 0
toList (a,b) = [a,b]
prettyShow False = "0"
require 'benchmark'
include Benchmark
n = 10000000
Benchmark.bm do |test|
test.report("Double quotes:") do
n.times do |x|
str = "A string without newline"
end
end
module Clusterizer (clusterValues, Pair, Cluster, massCenter) where
import Data.List
type Pair = (Int, Int)
type Cluster = [Pair]
compareFirst a b = compare (fst a) (fst b)
box :: a -> [a]
-- statusd_eee.lua
--
-- Public domain
--
-- Uses the /proc/acpi interface to get eeePC devices' status
-- b is for bluetooth, c is for camera, w is for wifi
-- uppercase letter means that device is on, lowercase - off
local defaults={
update_interval = 10*1000,
@Voker57
Voker57 / gist:95262
Created April 14, 2009 16:19
ruby-like haskell
import Prelude hiding((.))
a . b = b a
main = do {
"-*-Hello world-*-".splitAt(3).snd.splitAt(11).fst.print
}
fn1 = fn2
fn2 = fn1
a = a
-- try to evaluate any of variables
class ConstHash < Hash
def []=(name, value)
if has_key? name
raise "Can't rebind #{name}"
else
super name, value
end
end
end