Skip to content

Instantly share code, notes, and snippets.

;; Don't use ScheduledThreadPoolExecutor, just loop and execute tests directly
(deftask lazytest
"Just fire up lazy test on src and test for now"
(bake (:use lazytest.watch)
(:require lazytest.runner.console
lazytest.report.nested) []
(let [runner (reloading-runner ["src" "test"] lazytest.runner.console/run-tests lazytest.report.nested/report)]
(while true
(runner)
;; 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)))
(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")))
@ninjudd
ninjudd / lion_fullscreen.diff
Created September 15, 2011 14:33 — forked from rust/emacs.rb
Homebrew Emacs for OSX Lion with native full-screen
diff --git a/src/nsterm.m b/src/nsterm.m
index 5348b20..a0c808e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1162,7 +1162,9 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f);
compute_fringe_widths (f, 0);
- if ([window isKindOfClass:[EmacsFullWindow class]]) {
+ BOOL inFullScreen = ([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask;
def reductions(*args, &fn)
fn ||= args.shift
Utils.verify_args(args, 0, 1)
acc, coll = (args.empty? ? divide : [args.first, self])
F.lazy_loop(acc, coll) do |recur, acc, coll|
if coll.seq
acc = fn[acc, coll.first]
F.cons(acc, recur[acc, coll.rest])
end
@ninjudd
ninjudd / gist:1263106
Created October 4, 2011 23:00 — forked from Raynes/gist:1262815
cake 0.6.3
(defproject ustate "0.0.1-SNAPSHOT"
:description "A state aggregation daemon"
:tasks [protobuf.tasks]
:dependencies [[org.clojure/clojure "1.2.1"]
;[classlojure "0.6.1"]
[clojure-protobuf "0.4.6"]]
:dev-dependencies [[clojure-protobuf "0.4.6"]])
@ninjudd
ninjudd / gist:1263119
Created October 4, 2011 23:11 — forked from Raynes/gist:1262815
cake 0.7.0-alpha1
(defproject ustate "0.0.1-SNAPSHOT"
:description "A state aggregation daemon"
:tasks [protobuf.tasks]
:dependencies [[org.clojure/clojure "1.2.1"]
;[classlojure "0.6.1"]
[protobuf "0.5.0-alpha6"]]
:cake-plugins [[cake-protobuf "0.5.0-alpha5"]])
(is (= (assoc node2 :id "1")
(-> layer-name
(write-txn (assoc-node "1" node2)
(update-node "1" assoc :baz [1 2 3])
(update-node "1" dissoc :baz))
(get-node "1"))))
;; the above is sugar for the below. seem useful?
(let [layer (layer layer-name)]
(dotxn layer
(-> layer
if Rails.version == '2.3.8' && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel)
# Pulled right from latest rack. Old looked like this in 1.1.0 version.
#
# def [](k)
# super(@names[k] ||= @names[k.downcase])
# end
#
module Rack