Skip to content

Instantly share code, notes, and snippets.

View stianeikeland's full-sized avatar

Stian Eikeland stianeikeland

View GitHub Profile
require "formula"
class Flashrom < Formula
homepage "http://flashrom.org/"
url "http://download.flashrom.org/releases/flashrom-0.9.7.tar.bz2"
sha1 "d08b4073ea3ebf63f03c3e502f4291f50ef348ee"
head "svn://flashrom.org/flashrom/trunk", :using => :svn
depends_on 'libusb-compat'
(def 🔟 10)
(def 🚲 cycle)
(def ✊ take)
(def 🏁 (🚲 [:🚕 :🚗 :🚚 :🚒 :🚐]))
(✊ 🔟 🏁)
{:user {:dependencies [[org.clojure/tools.namespace "0.2.3"]
[spyscope "0.1.3"]
[criterium "0.4.1"]]
:injections [(require '(clojure.tools.namespace repl find))
; try/catch to workaround an issue where `lein repl` outside a project dir
; will not load reader literal definitions correctly:
(try (require 'spyscope.core)
(catch RuntimeException e))]
:plugins [[lein-pprint "1.1.1"]
[lein-beanstalk "0.2.6"]
@stianeikeland
stianeikeland / ast.jison
Last active January 1, 2016 00:39
XMASLANG to Javascript compiler - AST from jison
%lex
%%
\s+ /* skip whitespace */
\n+ /* skip whitespace */
[0-9]+ return 'NUMBER'
"->" return 'MAP'
"=?" return 'FILTER'
"$" return 'REDUCE'
"*" return '*'
@stianeikeland
stianeikeland / Shrink.qfilter
Created December 10, 2013 20:18
Quartz filter for better (actually readable) PDF size reduction on osx (in Preview.app) Put it in /System/Library/Filters
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Domains</key>
<dict>
<key>Applications</key>
<true/>
<key>Printing</key>
<true/>
Gox = require 'goxstream'
JSONStream = require 'json-stream'
Boxcar = require 'boxcar'
osxnotify = require 'osx-notifier'
log = require 'npmlog'
argv = (require 'optimist')
.usage('Usage: $0')
.alias('h', 'high')
@stianeikeland
stianeikeland / gamesim.coffee
Created September 11, 2013 20:58
Tennis kata
{Game, Player, Advantage} = require "./main"
playGame = (gamedata) ->
game = new Game
for x in gamedata.split " "
game.setAdvantage Advantage.playerA if x is "advA"
game.setAdvantage Advantage.playerB if x is "advB"
game.pointA() if x is "pointA"
game.pointB() if x is "pointB"
package main
import (
"fmt"
"os"
"reflect"
"syscall"
"unsafe"
)
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"strconv"
"strings"
)
func GetFloridaFloat(datarows *goquery.Selection, field int) (data float64, err error) {
// A concurrent prime sieve
package main
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func Generate(ch chan<- int) {
for i := 2; ; i++ {
ch <- i // Send 'i' to channel 'ch'.
}
}