Skip to content

Instantly share code, notes, and snippets.

$ rake routes
Prefix Verb URI Pattern Controller#Action
tasks GET /tasks(.:format) tasks#index
POST /tasks(.:format) tasks#create
task GET /tasks/:id(.:format) tasks#show
PATCH /tasks/:id(.:format) tasks#update
PUT /tasks/:id(.:format) tasks#update
DELETE /tasks/:id(.:format) tasks#destroy
new_api_v1_user_session GET /api/v1/users/sign_in(.:format) api/v1/sessions#new
api_v1_user_session POST /api/v1/users/sign_in(.:format) api/v1/sessions#create
@hhutch
hhutch / keybase.md
Created June 4, 2014 21:16
keybase.io proof

Keybase proof

I hereby claim:

  • I am hhutch on github.
  • I am huntar (https://keybase.io/huntar) on keybase.
  • I have a public key whose fingerprint is 55C5 B5A7 3183 B8A3 42A4 6E5C 2817 C03B 0067 8908

To claim this, I am signing this object:

Org-Mode_Plus_Calc_Plus_Macro_Magic

Know thy tools, to know thyself

Emacs has some incredibly powerful tools by themselves, but combined you can have superpowers.

example

ÿØÿàJFIFHHÿÛC

   ÿÛC   ÿÂ@kÿÄÿÄÿÚ þ© À š8Í
@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]
(ns maze.core)
(def *size* 20)
(defn walk [start]
(iterate (fn [[x y]]
(first (shuffle (filter (fn [lst]
(every? (fn [k]
(< -1 k *size*))
lst))
;; 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