Skip to content

Instantly share code, notes, and snippets.

View hellonico's full-sized avatar

Nicolas Modrzyk hellonico

  • Karabiner Software
  • Tokyo
View GitHub Profile
export version=1.5.3
if [ "$#" -gt 0 ] ; then
export version="$1"
fi
echo "Installing Dropbox SDK version $version"
wget https://www.dropbox.com/static/developers/dropbox-java-sdk-$version.zip
unzip dropbox-java-sdk*
cd dropbox-java-sdk*
(defproject streamhubstats "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main streamhubstats.core
:dependencies [
[org.clojure/clojure "1.5.1"]
[clj-http "0.7.6"] ; https://github.com/dakrone/clj-http
[clj-time "0.5.1"] ; https://github.com/seancorfield/clj-time
(ns imaging.core)
(import 'java.awt.image.BufferedImage)
(use 'clojure.java.io)
(import '[javax.swing JFrame JLabel ImageIcon])
(defn setpxl [^BufferedImage image data]
(let [h (.getHeight image)
w (.getWidth image)]
(.setRGB image 0 0 w h ^ints data 0 w)
@hellonico
hellonico / loom
Last active August 29, 2015 13:59
Playing with loom
; https://github.com/aysylu/loom
(require-lib '[[aysylu/loom "0.4.2"]])
(use 'loom.graph)
(use 'loom.io)
; define the graph
(def g (graph [1 2] [2 3] {3 [4] 5 [6 7]} 7 8 9))
; view the graph if you have graphviz included
@hellonico
hellonico / frak
Created April 11, 2014 06:14
playing with frak
(require 'frak)
(frak/pattern ["foo" "bar" "baz" "quux"])
; #"(?:quux|foo|ba[zr])"
(frak/pattern ["Clojure" "Clojars" "ClojureScript"])
; #"Cloj(?:ure(?:Script)?|ars)"
(frak/pattern ["skill" "skills" "skull" "skulls"])
; #"sk(?:[ui]lls?)"
@hellonico
hellonico / Tak.nim
Last active August 29, 2015 14:19
Tak in nim
var
i:int = 0
proc tak(x, y, z:int):int =
if x <= y:
y
else:
i = i + 1
tak(tak(x-1, y, z),tak(y-1, z, x),tak(z-1, x, y))
public class Tak {
static long number = 0;
public static long tak(long x, long y, long z) {
if (x <= y)
return y;
else
number ++;
return
tak(tak(x-1, y, z),tak(y-1, z, x),tak(z-1, x, y));