I hereby claim:
- I am honza on github.
- I am honza (https://keybase.io/honza) on keybase.
- I have a public key whose fingerprint is 70E0 3E0A A2E5 40EA A2FB 4422 67C0 AD96 97D5 AB41
To claim this, I am signing this object:
8000
(defn update-keys [m ks f] | |
(let [g (fn [c k] | |
(update-in c [k] f))] | |
(reduce g m ks))) | |
(update-keys {:a 1 :b 2} [:a :b] inc) | |
;; => {:a 2 :b 3} |
-- This is a Haskell implementation of aphyr's | |
-- "Clojure from the ground up - modeling" | |
-- | |
-- http://aphyr.com/posts/312-clojure-from-the-ground-up-modeling | |
-- | |
-- Compile this with: | |
-- | |
-- $ ghc -O Rocket.hs | |
import GHC.Exts |
class Functor f where | |
fmap :: (a -> b) -> f a -> f b | |
class (Functor f) => Applicative f where | |
pure :: a -> f a | |
(<*>) :: f (a -> b) -> f a -> f b | |
(<$>) :: (Functor f) => (a -> b) -> f a -> f b | |
class Monad m where |
I hereby claim:
To claim this, I am signing this object:
function cabal_prompt | |
if [ -e "cabal.sandbox.config" ] | |
printf '(cabal sandbox)' | |
end | |
end |
;; If you name your impure functions with a name ending in "!", | |
;; you can use this handy macro to check if a form uses any impure functions. | |
(declare find-impure) | |
(defn ends-in-bang? [s] | |
(= \! (last (str s)))) | |
(defn impure? [e] | |
(cond |
(def app {}) | |
(defmacro fnj [args & body] | |
(if (empty? args) | |
`(fn [] ~@body) | |
`[~@(map name args) (fn ~args ~@body)])) | |
(defmacro def-controller [module n args & body] | |
`(.controller ~module ~(name n) (fnj ~args ~@body))) |
dactyl/pentadactyl/../common/make_jar.sh: line 47: unexpected EOF while looking for matching `'' | |
make: *** [chrome/] Error 2 |
// Given | |
var content = { | |
id: 1, | |
name: 'Honza' | |
}; | |
function renderTemplate(content) { | |
return 'Hello, ' + content.name; | |
} |
Developing in Clojure seems to require tons of RAM. I'm currently working on a small HTTP service: 200 LOC, minimal dependencies. I'm using lein ring server-headless
to run a development server, and I'm using Emacs and the CIDER repl. This spins up 4 java processes on my machine, 2 for the server and 2 for CIDER.
That's almost 3GB of RAM. If you're also running a VM in virtualbox or VMware, your computer is gonna have a bad time.
VMware Fusion is using only 200MB of RAM. No idea how that's possible.