Skip to content

Instantly share code, notes, and snippets.

View ulsa's full-sized avatar

Ulrik Sandberg ulsa

  • IKEA IT
  • Skåne, Sweden
  • X @ulsa
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ulsa on github.
  • I am ulsa (https://keybase.io/ulsa) on keybase.
  • I have a public key ASCJGaXiZ5ouojbzSo24LN7hCGna9inlUJC8vJZHuSg4Uwo

To claim this, I am signing this object:

$ bosh verify stemcell latest-bosh-stemcell-warden.tgz
Verifying stemcell...
File exists and readable OK
Verifying tarball...
Read tarball OK
Manifest exists OK
Stemcell image file OK
Stemcell properties OK
@ulsa
ulsa / gist:3514564
Created August 29, 2012 15:41
pallet deps
[INFO] +- org.cloudhoist:pallet-lein:jar:0.5.2-SNAPSHOT:test
[INFO] +- org.clojure:clojure:jar:1.3.0:compile
[INFO] +- org.cloudhoist:pallet-jclouds:jar:1.4.1:compile
[INFO] | +- org.jclouds:jclouds-compute:jar:1.4.2:compile
[INFO] | | +- org.jclouds:jclouds-scriptbuilder:jar:1.4.2:compile
[INFO] | | \- org.jclouds:jclouds-core:jar:1.4.2:compile
[INFO] | | +- net.oauth.core:oauth:jar:20100527:compile
[INFO] | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.11:compile
[INFO] | | +- com.google.inject.extensions:guice-assistedinject:jar:3.0:compile
@ulsa
ulsa / destructuring2.clj
Created August 4, 2012 17:12
Decimal to Roman Numeral converter, 2
(let [ [fst snd] (filter odd? [1 2 3 4 5])]
(println fst snd))
=> 1 3
@ulsa
ulsa / destructuring1.clj
Created August 4, 2012 17:04
Decimal to Roman Numeral converter
(let [lst (filter odd? [1 2 3 4 5])
fst (first lst)
snd (second lst)]
(println fst snd))
=> 1 3
@ulsa
ulsa / add-attr.clj
Created June 27, 2012 15:23
Find Out Who Changed What with Datomic, 2
user=> @(d/transact conn
[{:db/id #db/id[:db.part/db]
:db/ident :audit/user
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/index true
:db.install/_attribute :db.part/db}])
@ulsa
ulsa / changed.clj
Created June 27, 2012 14:45
Finding Out Who Changed What with Datomic
user=> (distinct (map :e (d/datoms (d/since (db conn) #inst "2012-06-25T10:33:16.436-00:00") :eavt)))
(13194139534683 17592186045460)
@ulsa
ulsa / neighbors.clj
Created May 4, 2012 07:45
neighbors for a cell in clojurescript
cljs.user> (neighbors [1 1])
([0 0] [0 1] [0 2] [1 0] [1 2] [2 0] [2 1] [2 2])
@ulsa
ulsa / core.cljs
Created April 9, 2012 21:59
ClojureScript code for accessing the Karotz toy rabbit
(ns clojurekarotz.core
(:require [clojurekarotz.util :as u]))
(def quit (fn [event] (if (= event "TERMINATED") (js/exit))))
(defn onKarotzConnect [data]
(.moveRelative (.-ears js/karotz) 5 -5 (fn [_]))
(.start (.-tts js/karotz) "Buenos dias Clojure. Como estas? Tienes animales?" "es" quit))
(.connectAndStart js/karotz "192.168.1.13" 9123 onKarotzConnect (js-obj))
(defn test []
    (println "Hello World!")
)
(test)