Skip to content

Instantly share code, notes, and snippets.

@hhutch
hhutch / fib.clj
Last active September 15, 2015 22:13 — forked from nasser/fib.clj
Fibonacci sequence in Clojure/LLVM
;; https://pauladamsmith.com/blog/2015/01/how-to-get-started-with-llvm-c-api.html
(import LLVM
LLVMModuleRef
LLVMTypeRef
Wrap
LLVMBool
LLVMLinkage)
(def genstr (comp str gensym))
;; Datomic sample code
;; schema query for attribute types in specified namespaces
(q '[:find ?attr
:in $ [?include-ns ...] ;; bind ?include-ns once for each item in collection
:where
[?e :db/valueType] ;; all schema types (must have a valueType)
[?e :db/ident ?attr] ;; schema type name
[(datomic.Util/namespace ?attr) ?ns] ;; namespace of name
[(= ?ns ?include-ns)]] ;; must match one of the ?include-ns
@hhutch
hhutch / maze.clj
Last active August 29, 2015 14:22 — forked from cgrand/maze.clj
; http://groups.google.com/group/clojure/browse_thread/thread/974e2c7f89e27231/5f4bff3e58dfa36f
; output images http://i.imgur.com/gSASS.png (square maze)
; http://i.imgur.com/uEqaq.png (hex maze)
;; generic Wilson's algorithm implementation
(defn maze
"Returns a random maze carved out of walls; walls is a set of
2-item sets #{a b} where a and b are locations.
The returned maze is a set of the remaining walls."
[walls]
@hhutch
hhutch / bash-throbber.sh
Last active December 14, 2015 19:38 — forked from anonymous/bash-throbber.sh
Throbber using UTF8 clock
#!/usr/bin/env bash
C="0" # count
while [ $C -lt 30 ]
do
case "$(($C % 11))" in
0) char="\xF0\x9F\x95\x90"
;;
1) char="\xF0\x9F\x95\x91"
;;
@hhutch
hhutch / hacklog.textile
Created November 20, 2011 13:37 — forked from candera/hacklog.textile
Hack Log

This is my score for the “One Hundred Days of Hacking” game. Rules here.

Date Score Commit Comment
23/12/2011 1 3ce034fcef cljs-closure-demos
9/12/2011 18 OH NO!!
8/12/2011 17 a96b9e546e cljs-closure-demos
7/12/2011 16 1ec55ea6d3 cljs-closure-demos
6/12/2011 15 cad1abbe98 cljs-closure-demos
5/12/2011 14 89b9a6e50e straw
4/12/2011 13 df6f5f8028 straw