Comments? [email protected]
- Emacs learning curve?
- Mix of Emacs geeks skewed towards people who’ve been using this for a while (after all, takes a certain commitment to come all the way to an Emacs conference!)
| (defn to-float [x] | |
| (when x (Float/parseFloat x))) | |
| (defn to-int [x] | |
| (when x (Integer/parseInt x))) | |
| (defn process-data [data] | |
| (let [field-format (array-map :id to-int | |
| :name identity | |
| :score to-float)] |
| ; using https://code.google.com/p/language-detection/ | |
| ; i.e. [com.cybozu.labs/langdetect "1.1-20120112"] | |
| (require '[clojure.java.io :as io]) | |
| (->> #{"af" "ar" "bg" "bn" "cs" "da" "de" "el" "en" "es" "et" "fa" "fi" "fr" "gu" | |
| "he" "hi" "hr" "hu" "id" "it" "ja" "kn" "ko" "lt" "lv" "mk" "ml" "mr" "ne" | |
| "nl" "no" "pa" "pl" "pt" "ro" "ru" "sk" "sl" "so" "sq" "sv" "sw" "ta" "te" | |
| "th" "tl" "tr" "uk" "ur" "vi" "zh-cn" "zh-tw"} | |
| (map (partial str "profiles/")) |
Comments? [email protected]
| Check out README.md to get started editing Clojure with Emacs. |
This configuration works with Upstart on Ubuntu 12.04 LTS
The reason why it needs to be done this way (i.e. with the pre-start and post-stop stanzas), is because Upstart
is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys
and run Unicorn in foreground also, it then only needs one exec stanza.
This presumes you are not using RVM, so no voodoo dances.
| #! /usr/bin/env bash | |
| # Author: Damien Cassou | |
| # | |
| # This is the script I use to build Emacs packages for Ubuntu. These | |
| # packages are uploaded to | |
| # https://launchpad.net/~cassou/+archive/emacs/. Each package is | |
| # either build from a Debian package or from | |
| # http://emacs.naquadah.org/. |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| (defn c+ [[re1 im1] [re2 im2]] [(+ re1 re2) (+ im1 im2)]) | |
| (defn c* [[re1 im1] [re2 im2]] | |
| [(- (* re1 re2) (* im1 im2)) (+ (* re1 im2) (* im1 re2))]) | |
| (defn c2 [c] (c* c c)) | |
| (defn |c| [[re im]] (Math/sqrt (+ (* re re) (* im im)))) | |
| (defn get-mandel-set [im-range re-range max-iter] | |
| (for [im im-range | |
| re re-range | |
| :let [c [re im]]] |
| (ns recursive-tricks.recursive-tricks) | |
| (defn uuid [] (str (java.util.UUID/randomUUID))) | |
| (defn tail-recursive [f] | |
| (let [state (ref {:func f :first-call true :continue (uuid)})] | |
| (fn [& args] | |
| (let [cont (:continue @state)] | |
| (if (:first-call @state) | |
| (let [fnc (:func @state)] |
| framework 'Cocoa' | |
| framework 'QuartzCore' | |
| class NSColor | |
| def toCGColor | |
| colorRGB = self.colorUsingColorSpaceName NSCalibratedRGBColorSpace | |
| components = Array.new(4){Pointer.new(:double)} | |
| colorRGB.getRed components[0], green:components[1], blue:components[2], alpha:components[3] |