Skip to content

Instantly share code, notes, and snippets.

odyssomay / gist:4027155
Created Nov 6, 2012
Better bracket highlighting for the SpaceCadet color scheme in sublime
View gist:4027155
<!-- add: -->
odyssomay / split.cljs
Created Oct 25, 2012
jQuery Split pane
View split.cljs
(ns ui.split
(:require [ui.trigger :as trigger]
[jayq.util :as util])
(:use [jayq.core :only [$ append css inner]]))
(defn set-css [outer f-elem s-elem options]
(let [{:keys [split-type start-position]} options
base-css (case split-type
:vertical {:width "100%"}
:horizontal {:float "left" :height "100%"})
odyssomay / rresize.js
Created Oct 25, 2012
rresize: jquery plugin for recursive resizing
View rresize.js
* rresize, jquery plugin by Jonathan Fischer Friberg
* Licensed under WTFPL
* Usage:
odyssomay / gist:3893111
Created Oct 15, 2012
"Failed" dungeon generation
View gist:3893111
(defn rooms-intersect?
[{[x1 y1] :offset [sx1 sy1] :size} {[x2 y2] :offset [sx2 sy2] :size}]
(not (or (>= x1 (+ x2 sx2))
(>= y1 (+ y2 sy2))
(>= x2 (+ x1 sx1))
(>= y2 (+ y1 sy1)))))
(defn is-inside-room? [[x y] {[xr yr] :offset [sx sy] :size}]
(and (> x xr)
(< x (dec (+ xr sx)))
odyssomay / profile.clj
Created Aug 4, 2012
clojure.contrib.profile for 1.3+
View profile.clj
;;; profile.clj: simple code profiling & timing
;; by Stuart Sierra,
;; May 9, 2009
;; Copyright (c) Stuart Sierra, 2009. All rights reserved. The use
;; and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By using this software in any fashion, you are
odyssomay / test.cljs
Created Oct 18, 2011
Clojurescript symbol to string
View test.cljs
(ns test)
(console/log (str 'a))
odyssomay / SpecRunner.html
Created Oct 14, 2011
Clojurescript testing using jasmine
View SpecRunner.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="jasmine/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="jasmine/jasmine.css">
<script type="text/javascript" src="jasmine/jasmine.js"></script>
View gist:1209498
(ns trace
(:use clojure.pprint))
(declare trace-form)
(def *ignore*
'#{def quote var try monitor-enter monitor-exit})
(defmulti trace-special-form (fn [form] (first form)))
odyssomay / gist:1078370
Created Jul 12, 2011
the longest java stacktrace I have seen
View gist:1078370
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at java.util.IdentityHashMap.get(
at javax.swing.RepaintManager.extendDirtyRegion(
at javax.swing.RepaintManager.addDirtyRegion0(
at javax.swing.RepaintManager.addDirtyRegion(
at javax.swing.JComponent.repaint(
at java.awt.Component.repaint(
at javax.swing.text.DefaultCaret.repaint(
at javax.swing.text.DefaultCaret.changeCaretPosition(
at javax.swing.text.DefaultCaret.handleSetDot(
View gist:1073506
(defn extract-points [iterator]
(fn []
(let [points (make-array Double/TYPE 6)]
(.currentSegment iterator points)
(.next iterator))))
(defn extract-all-points [path_iterator]
(take-while (fn [_] (not (.isDone path_iterator)))
(repeatedly (extract-points path_iterator))))
You can’t perform that action at this time.