This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns test.core) | |
(defrecord Person [name]) | |
(def fred (Person. :fred)) | |
(def test-direct ; fine | |
(.name ^Person fred)) | |
(def test-no-hint ; fine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro are | |
"Same as clojure.test/are, except returns true if all tests pass." | |
[syms test & vals] | |
(let [c (count syms) | |
points (partition-all c vals)] | |
(list `every? | |
`identity | |
(into [] | |
(for [pt points] | |
`(let [~@(interleave syms pt)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
i=0 | |
echo "i is $i" | |
let "n = i * 2" | |
echo "n is $n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;; Provided by Alec | |
;; add el-get to the load-path | |
(add-to-list 'load-path "~/.emacs.d/el-get/el-get") | |
;; install it if we don't already have it | |
(require 'el-get) | |
;;(unless (require 'el-get "" t) | |
;; (message "Couldn't require el-get, installing it now...") | |
;; (let* ((installer-buffer (url-retrieve-synchronously | |
;; (concat "https://github.com/dimitri/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expected = { | |
0:{ | |
0:set([]), | |
1:set([0,5]), | |
2:set([0,1,5]), | |
3:set([0,1,2,5]), | |
4:set([0,1,2,3,5]), | |
5:set([]) | |
}, | |
1:{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro kf [& args] | |
(let [is-key #(= \_ (last (str %))) | |
ks (filter is-key args) | |
as (filter (complement is-key) args)] | |
(let [n (symbol (apply str (map name ks)))] | |
`(~n ~@as)))) | |
(defn do_not_ [a b] a) | |
(kf do_ 2 not_ (+ 3 4)) ;; (do_not_ 2 (+ 3 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
529 gkatsev | |
198 mheld | |
195 lauren | |
190 TimMc | |
71 cmccoy | |
35 kerrg | |
23 bahsiek | |
17 asm | |
15 thang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clj.core) | |
(defmulti foo type) | |
(defmethod foo ::common [_] "common") | |
(defmethod foo :default [_] "default") | |
(derive String ::common) | |
(derive Math ::common) | |
(defn -main [& args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Read from stdin and print chunks with checksums.""" | |
from __future__ import print_function | |
import sys | |
import md5 | |
chunk_size = 40 | |
def part_str(s, l): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This evaluates properly... | |
(defn barr= | |
([x] true) | |
([^bytes x ^bytes y] | |
(java.util.Arrays/equals x y)) | |
([x y & more] | |
(if (barr= x y) | |
(if (next more) | |
(recur y (first more) (next more)) | |
(barr= y (first more))) |