Skip to content

Instantly share code, notes, and snippets.

(deftask foo [{[a b c] :baz}]
(println "important code that depends on --baz" a b c))
;; in some other file
(deftask foo [{[a] :bar}]
(println "important extension that depends on --bar" a))
31
15 30
7 14 22 29
3 6 10 13 18 21 25 28
1 2 4 5 8 9 11 12 16 17 19 20 23 24 26 27
ubuntu:~ $ dpkg --list | grep ruby
ii libdaemons-ruby 1.0.10-2 Ruby daemons library
ii libdaemons-ruby1.8 1.0.10-2 Ruby daemons library
ii libgemplugin-ruby 0.2.3-2 Gem Based Plugin System
ii libgemplugin-ruby1.8 0.2.3-2 Gem Based Plugin System
ii libopenssl-ruby 4.2 OpenSSL interface for Ruby
ii libopenssl-ruby1.8 1.8.7.174-1ubuntu1 OpenSSL interface for Ruby 1.8
ii libreadline-ruby1.8 1.8.7.174-1ubuntu1 Readline interface for Ruby 1.8
ii libruby 4.2 Libraries necessary to run Ruby 1.8.x
ii libruby1.8 1.8.7.174-1ubuntu1 Libraries necessary to run Ruby 1.8
;; wouldn't it be nice if...
(def-type-multis DataRow
(get-column-names [this])
(get-value [this column-name]))
(defmethods DataRow
clojure.lang.Associative
(get-column-names [this]
(range (count this)))
;; doesn't work because the body may not always be fully realized
(defn- read-body [in length & [buffer offset]]
(lazy-seq
(if length
(if (= 0 length)
nil
(let [buffer (or buffer (char-array length))
offset (or offset 0)
count (.read in buffer offset length)]
(defn branch-revision [version]
(let [[branch version] (reverse (split version #"/"))]
{:branch branch :version version}))
(ns apij.indexer
(:use
cake
cake.core))
(deftask index_from_mongo
"Produce and index from a mongo database"
(bake (:require [somnium.congomongo :as congo]) []
(congo/mongo! :db "rva_en")
(println "TESTING")))
(ns sexpbot.plugins.logger
(:use [sexpbot respond]
[clj-time.core :only [now]]
[clj-time.formatters :only [unparse formatters]])
(:import [java.io File]))
(defplugin
(:hook
:on-message
(fn [{:keys [bot nick channel message]}]
:configurations {:default-mapping "default->default"
"default" {}
"compile" {:extends "default" :description "Compile time dependencies."}
"runtime" {:extends "compile" :description "Runtime dependencies."}
"devel" {:visibility "private"}}
:publications {:default-conf "master,default"
"itch" {:type "jar"}
"itch-jetty" {:type "jar" conf="jetty"}}