This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(partial reduce | |
(fn [acc n] | |
(if (= (first (last acc)) n) | |
(vec (conj (vec (butlast acc)) (conj (last acc) n))) | |
(vec (conj acc [n])))) | |
[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jinja.coffee: a minuscule DI container for javascript/coffeescript | |
# | |
# Put your class dependencies under meta.needs and needs_modules, and | |
# you'll get a hash of whan you asked for as a constructor parameter. A | |
# useful idiom is to stash the whole thing in a property named 'd', | |
# for dependencies. | |
# | |
# class A | |
# @meta: | |
# needs: ["someParam"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let's have a race! the app needs to start before the testRunner hits it | |
app = require '../app' | |
app.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v = vows.describe('main json api').addBatch | |
'when requesting a bad top level': | |
topic: -> request "#{baseUrl}/bogus", @callback ; return | |
'it 404s': | |
(err, res, body) -> assert.equal res.statusCode, 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
winston = require 'winston' | |
level = 'info' | |
level = 'debug' if process.env.NODE_ENV is 'development' | |
levels = | |
debug: 0 | |
info: 1 | |
warn: 2 | |
error: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'fileutils' | |
include FileUtils | |
files = `find /Applications/Xcode.app -path *.xctemplate/*.h -o -path *.xctemplate/*.m`.split("\n") | |
backupDir = File.expand_path "~/.xcTemplateBackup" | |
mkdir backupDir unless File.exists? backupDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'robert.hooke) | |
(use ['leiningen.compile :rename {'compile 'compile-task}]) | |
(prepend compile-task | |
(prn "hello")) | |
(defproject ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hard-coded imperialism | |
if(! lang.equals("en")){ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env osascript | |
tell application "Xcode" | |
activate | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns xml-test | |
(:use [clojure.test] | |
[clojure.data.zip.xml]) | |
(:require [clojure.xml :as xml] | |
[clojure.zip :as zip])) | |
(defn parse-str [s] | |
(zip/xml-zip (xml/parse (new org.xml.sax.InputSource | |
(new java.io.StringReader s))))) |
OlderNewer