Skip to content

Instantly share code, notes, and snippets.

View wilkes's full-sized avatar

Wilkes Joiner wilkes

View GitHub Profile
@wilkes
wilkes / core.clj
Created December 5, 2011 17:18
Conway using sets
(ns conways.core
(:use midje.sweet)
(:require [clojure.set :as s]))
(unfinished )
(def offsets [-1 0 1])
(defn neighbors [[x y]]
(s/difference (set (for [x-offset offsets y-offset offsets]
[(+ x x-offset)
(defproject floyd "0.10.4-SNAPSHOT"
:dependencies ...
;; compile this one file
:aot [floyd.version]
)
;; Really debug.cljs
(ns floyd.debug
(:require [goog.events :as events]
[goog.object :as o]
[goog.debug.Console :as Console]
[goog.debug.LogManager :as LogManager]
[goog.debug.Logger :as Logger]
[goog.ui.Component.EventType :as et]
[goog.events.EventType :as EventTypes]))
(defn custom-button [parent text]
(let [container (html/el "span")
button (goog.ui.CustomButton. text)]
(dom/append parent container)
(.render button container)
{:element container :component button}))
(ns treeviewer.core
(:require [goog.dom :as dom]
[goog.ui.tree.TreeControl :as TreeControl]))
(def data {:a 1 :b [1 2] :c {:d 1 :e 2 :f "foo"}})
(declare add-data)
(defn tree-control []
(goog.ui.tree.TreeControl.
floyd = {
'staging': {
'cron.d': ['*/10 * * * * deploy java "-Duser.timezone=US/Central" -server -Xmx1024M -cp /apps/floyd/floyd-standalone.jar clojure.main /apps/floyd/cisco_import.clj >> /apps/floyd/cisco_import.log 2>&1'],
'scripts': ['cisco_import.clj', 'run.clj'],
'nginx' : {
'server_name': 'stage.floyd.dev.notifymd.local',
'port': 8080
}
'supervisord' : {
'mx' = '1024M'
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-o
bind-key C-o last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color"
@wilkes
wilkes / higher_order.clj
Created January 28, 2011 20:52
testing higher order functions with midje 1.0.1
(ns higer-order
(:use midje.sweet))
(defn sum-with [f vs]
(apply + (map f vs)))
(defn double [x]
(* x 2))
(defn sum-double [xs]
@wilkes
wilkes / config-js2.el
Created January 12, 2011 15:52
js2-mode indentation
;; http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode
(defun my-js2-indent-function ()
(interactive)
(save-restriction
(widen)
(let* ((inhibit-point-motion-hooks t)
(parse-status (save-excursion (syntax-ppss (point-at-bol))))
(offset (- (current-column) (current-indentation)))
(indentation (espresso--proper-indentation parse-status))
node)
(ns pfad.ch1)
(set! *warn-on-reflection* true)
;; Compute the smallest natural number not in a given finite set of X
;; natural numbers.
;; Array based solution
;; minfree = search . checklist