Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View trptcolin's full-sized avatar

Colin Jones trptcolin

View GitHub Profile
@places = [
{:address=>'Dothan,AL',:description=>'Dothan is awesome'},
{:address=>'Athens,GA',:description=>'Athens is awesome'},
]
We couldn’t find that file to show.
@trptcolin
trptcolin / gist:9122852
Last active August 29, 2015 13:56
Cool story, Node
> parseInt('000039')
3
> parseInt('000039', 10)
39
@trptcolin
trptcolin / gist:9265825
Created February 28, 2014 05:26
amb implementation with delimc
(require '[delimc.core :as d])
(defmacro amb [xs]
`(d/shift k# (doseq [x# ~xs]
(k# x#))))
(d/reset
(let [a (amb [1 2 3])
b (amb ["a" "b" "c"])]
(println a b)))

Vim Regexes

When do I need a backslash?

  • this is all dependent on the "magic" option being set to the default, magic (:set magic? will tell you what you're set on)

  • vim regexes are beyond reason

  • (defn finds a literal paren, and \(defn\) creates a group.

  • | finds a literal pipe and, \| separates alternatives

@trptcolin
trptcolin / gist:11309006
Created April 26, 2014 01:13
Lein templates via `lein search`
Updating the search index. This may take a few minutes...
Searching over Artifact ID...
== Showing page 1 / 1
[heroku/lein-template "0.1.0"] Template for new ring-based Leiningen projects for Heroku.
[cljs-template/lein-template "0.1.5"] A lein-newnew template for clojurescript projects
[noir/lein-template "1.3.0"] A lein-newnew template for generating new noir projects.
[lein-gnome/lein-template "0.1.0-SNAPSHOT"] A template for new Gnome Shell extensions.
[pallet/lein-template "0.2.0"] Leiningen plugin for creating Pallet projects
[pallet/lein-template "0.2.1"] Leiningen plugin for creating Pallet projects
[cljs-template-one/lein-template "0.1.5"] A lein-newnew template for clojurescript projects
@trptcolin
trptcolin / spec_output.txt
Created June 23, 2014 03:47
speclj test output
(ns clj16.core-spec
(:require [speclj.core :refer :all]
[clj16.core :refer :all]))
(describe "tests"
(it "compares strings"
(should= "space" "spice"))
(it "compares maps 1"
(should== {:sheep 1} {:cheese 1 :sheep 1}))
user=> (sequence (comp (map inc) (map #(* % %))) (range 10))
(1 4 9 16 25 36 49 64 81 100)
user=> (map (comp inc #(* % %)) (range 10))
(1 2 5 10 17 26 37 50 65 82)
# Hackery idea
- Github API (get/use an api key - otherwise really limited)
$ curl -u 'USERNAME_HERE' -d '{"scopes":["repo"],"note":"help example"}' https://api.github.com/authorizations
- find all your organizations (paginated)
- find all usernames (grouped by org name) who are in that group
with you
/orgs

Found way fewer than I expected with bibliographies. But also way fewer 2009-present books. The select few w/ nice beefy bibliographies:

  • The Joy of Clojure (Fogus/Houser)
  • The Linux Programming Interface (Kerrisk)
  • Systems Performance (Gregg)
  • The Art of Multiprocessor Programming (Herlihy/Shavit)
  • Machine Learning (Flach)

I counted 8/18 tech books on my shelf since 2009 with bibliographies - way fewer than I'd have guessed. This is even w/ some selection bias towards the type of book that would have a bibliography, I suspect.