Skip to content

Instantly share code, notes, and snippets.

View chrisvest's full-sized avatar
🍉

Chris Vest chrisvest

🍉
View GitHub Profile
@chrisvest
chrisvest / .vimrc
Created February 22, 2009 00:32 — forked from bitprophet/.vimrc
.vimrc
syntax on
set background=dark
" Return cursor to the previous position when this file was open last
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
filetype plugin indent on
;; chrisvest's solution to http://4clojure.com/problem/28
(fn squash [xs]
(if (sequential? xs)
(mapcat squash xs)
(list xs)))
;; chrisvest's solution to http://4clojure.com/problem/29
(fn [s] (apply str (filter #(Character/isUpperCase %) s)))
;; chrisvest's solution to http://4clojure.com/problem/30
(fn [xs]
(reduce (fn [v x] (if (= x (last v)) v (conj v x))) [] xs))
;; chrisvest's solution to http://4clojure.com/problem/31
#(partition-by identity %)
;; chrisvest's solution to http://4clojure.com/problem/32
#(mapcat (fn [x] [x x]) %)
;; chrisvest's solution to http://4clojure.com/problem/33
(fn [xs n]
(mapcat #(replicate n %) xs))
;; chrisvest's solution to http://4clojure.com/problem/34
(fn [l h] (take (- h l) (iterate inc l)))
;; chrisvest's solution to http://4clojure.com/problem/38
(fn [& xs] (reduce (fn [a b] (if (> a b) a b)) 0 xs))
;; chrisvest's solution to http://4clojure.com/problem/39
(fn [a b] (mapcat vector a b))