Skip to content

Instantly share code, notes, and snippets.

# POST data for an individual listing
actAddJobToCart.requisitionNo
actDisplayProfiler.candidateNo
actDisplayProfiler.mode
actDisplayProfiler.requisitionNo
actDisplayReferralProfiler.candidateNo
actDisplayReferralProfiler.mode
actDisplayReferralProfiler.requisitionNo
actNbElementByPage.target
function addTodo()
{
var a = document.getElementById('list').getElementsByTagName('li')[0].firstChild.nodeValue;
var x=document.getElementById("nameOfItem").value;
if(x.length==""){
alert("Please eneter a ToDo item.");
}
else if(x.length > 200)
{
export CLASSPATH="/Users/daniel/jars/clojure-1.4.0/clojure-1.4.0.jar:$CLASSPATH"
alias "cljrepl"="java clojure.main"
@flyingmachine
flyingmachine / gist:2929345
Created June 14, 2012 09:45
my .emacs file
;; env PATH
(when (equal system-type 'darwin)
(setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH")))
(push "/opt/local/bin" exec-path)
(push "/usr/local/bin" exec-path))
;; text
(set-face-attribute 'default nil :height 140)
(load-theme 'deeper-blue)
@flyingmachine
flyingmachine / arenas.clj
Created June 15, 2012 02:05
routing for noir
(ns routey.views.arenas
(:require [routey.views.common :as common]
[noir.content.pages :as pages])
(:use noir.core
hiccup.core
hiccup.page-helpers
routey.views.routes))
@flyingmachine
flyingmachine / gist:3390402
Created August 18, 2012 23:52
Installing Ruby after upgrading from Snow Leopard to Mountain Lion

After you've done the steps below it will be as if you did an upgrade rather than a clean install. Your home directory will be there, as will your applications.

  1. Back up system to an external HD (I used Super Duper)
  2. Install mountain lion clean: http://eggfreckles.net/notes/installing-mountain-lion-clean/
  3. At the end of the install, transfer files back from my external HD
  4. Remove everything in /usr/local with sudo rm -Rf /usr/local/*
  5. Follow these instructions: http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/
  6. I had trouble with ree/1.8.7 so I had to follow these instructions: http://stackoverflow.com/questions/11664835/mountain-lion-rvm-install-1-8-7-x11-error/11666019#11666019
@flyingmachine
flyingmachine / gist:4004807
Created November 2, 2012 22:41
clojure korma heroku db connection
(defdb db
(if (System/getenv "DATABASE_URL")
(let [db-uri (java.net.URI. (System/getenv "DATABASE_URL"))
user-and-password (clojure.string/split (.getUserInfo db-uri) #":")]
{:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:user (get user-and-password 0)
:password (get user-and-password 1) ; may be nil
:subname (if (= -1 (.getPort db-uri))
(format "//%s%s" (.getHost db-uri) (.getPath db-uri))
(if (or (equal system-name "DH.local")
(equal system-name "DH.mba2"))
(setq initial-frame-alist '((top . 0) (left . 0)
(width . 177) (height . 47)))
(setq initial-frame-alist '((top . 0) (left . 0)
(width . 187) (height . 77))))
@flyingmachine
flyingmachine / robot.js
Created December 5, 2012 13:30
Jabroney
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(20);
robot.rotateCannon(45);
var r = robot.position.x % 2
@flyingmachine
flyingmachine / example-usage-after.clj
Created December 16, 2012 21:33
so far, only used in a web app when I want to update a subset of available fields. eg when changing a password
(defentity user
(has-many post)
(has-many comment)
;; todo move user param transform function here
(prepare
(fn [attributes]
(-> (transform-when-key-exists
attributes
{:password #(creds/hash-bcrypt %)