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
(clojure.pprint/pprint | |
(map vector | |
(range 25) | |
(cycle [:fizz :_ :_]) | |
(cycle [:buzz :_ :_ :_ :_]))) | |
; Credit to http://clojure-and-me.blogspot.co.uk/2012/08/functional-fizzbuzz.html, code rewritten a little by me. |
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
(defwidget my-widget | |
...) |
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
;;; Adds new defn-esque keyword highlighting. | |
(add-hook 'clojure-mode-hook '(lambda () | |
(font-lock-add-keywords nil '(("(\\(defwidget\\)\\s-+\\(\\w+\\)" | |
(1 font-lock-keyword-face) | |
(2 font-lock-function-name-face)))))) | |
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
; Add a function that runs for any Clojure buffer. | |
(add-hook 'clojure-mode-hook | |
; It's an anonymous function and it takes no arguments. | |
'(lambda () | |
; It calls the function that adds syntax-highlighting rules. | |
(font-lock-add-keywords nil | |
; So many escape codes! But behind those we're just saying: | |
; Match the '(' character. |
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
(defn possible-new-positions | |
[[x y]] | |
(map (fn [[x' y']] | |
[(+ x x') | |
(+ y y')]) (vec tron/legal-moves))) | |
(defn safe-move? | |
[look position] | |
(nil? |
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
(require 'nrepl-eval-sexp-fu) | |
(setq nrepl-eval-sexp-fu-flash-duration 0.25) | |
(defadvice lisp-eval-region (around lisp-eval-region-flash activate) | |
"Flash any calls to lisp-eval-region (and the functions that depend on it, like lisp-eval-defun)." | |
(let* ((start (ad-get-arg 0)) | |
(end (ad-get-arg 1)) | |
(flasher (nrepl-eval-sexp-fu-flash (cons start end))) | |
(hi (cadr flasher)) | |
(unhi (caddr flasher))) |
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
(defn setup [] | |
(smooth) | |
(frame-rate 3) | |
(background 200)) | |
(defn draw [] | |
(fill (random 255)) | |
(ellipse (random (quil/width)) | |
(random (quil/height)) | |
(random 100) |
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
class Thing { var x = 5 } | |
val things = scala.collection.immutable.List(new Thing) | |
println(things.head.x) // Prints 5 | |
things.head.x = 10 // WAT? | |
println(things.head.x) // Prints 10 |
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
class Thing { | |
var x = 5 | |
override def equals(o: Any) = o match { | |
case that: Thing => that.x == this.x | |
case _ => false | |
} | |
} | |
val a = new Thing | |
val b = new Thing | |
val stuff = scala.collection.immutable.Set(a, b) |
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
Bundle 'gmarik/vundle' | |
Bundle 'Lokaltog/vim-easymotion' | |
Bundle 'Shougo/neocomplcache' | |
Bundle 'altercation/vim-colors-solarized' | |
Bundle 'edsono/vim-matchit' | |
Bundle 'godlygeek/tabular' | |
Bundle 'johnsyweb/vim-makeshift' | |
Bundle 'jpalardy/vim-slime' |
OlderNewer