Skip to content

Instantly share code, notes, and snippets.

View travis's full-sized avatar

Travis Vachon travis

View GitHub Profile
(defun clean-applescript-input (s)
(replace-regexp-in-string
(regexp-quote "\"") "\\\\\""
(replace-regexp-in-string
(regexp-quote "\\") "\\\\\\\\" s)
)
)
(defun omni-quick-entry (beg end)
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Auto-Fill Column-Number Delete-Selection Diff-Auto-Refine
File-Name-Shadow Flyspell Font-Lock Global-Auto-Composition
Global-Font-Lock Hi-Lock Hl-Line Line-Number Mlinks Mouse-Wheel Nxhtml
Nxhtml-Global Pc-Selection Recentf Shell-Dirtrack Show-Paren
Transient-Mark
(Information about these minor modes follows the major mode info.)
Ruby/eruby-nxhtml mode:
2010-12-28 20:45:24
Full thread dump OpenJDK Client VM (17.0-b16 mixed mode, sharing):
"DestroyJavaVM" prio=10 tid=0xb4078000 nid=0x144f waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
"pool-1-thread-2" prio=10 tid=0x09fd2400 nid=0x145e in Object.wait() [0xb43d3000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x84b09430> (a edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue$SerializableLock)
lein swank
Exception in thread "main" java.lang.ClassCastException: java.io.File cannot be cast to clojure.lang.Named (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:458)
(ns outsidein-sandbox.core
(:use resrc.core
[clojure.contrib.json :only [read-json]]
[resrc-client.core :only [resource subresource]])
(:require [clj-http.client :as http])
(:import org.apache.commons.codec.digest.DigestUtils
java.net.URLEncoder))
(def *api-root* "http://hyperlocal-api.outside.in/v1.1/")
...F-...F---F-----F----F---F---F---F---FFF------------------------F---F---F---F---F---F---F---F----F----F----F----F---F-----F-------F----F---F---F---F----------F---F---F----F---F---F---F---F----F----F---F---F---F---F---F---F------F---F---F----F-----F---F---F---F----F-----F---F---F---F----F-----F---F---F---F----F-----F---F------F-----F-----F-------F-----F-----F-----F--------F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---
(::) failed steps (::)
expected "/Users/travis/dev/rspec-core/rspec-core.gemspec:17:in ``': Too many open files - git ls-files (Errno::EMFILE)\n\tfrom /Users/travis/dev/rspec-core/rspec-core.gemspec:17\n\tfrom /Users/travis/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/specification.rb:426:in `initialize'\n\tfrom /Users/travis/dev/rspec-core/rspec-core.gemspec:5:in `new'\n\tfrom /Users/travis/dev/rspec-core/rspec-core.gemspec:5\n" to include "does another thing"
Diff:
@@ -1,2 +1,6 @@
-does another thing
+/Users/travis/dev/rspec-core/rspec-core.gemspec:17:in ``': To
def complete_facebook_connect
within_window "Log In | Facebook" do
fill_in 'Email:', with: fb_user.email
fill_in 'Password:', with: fb_user.password
click_button "Log In"
# syncronization makes this never return, maybe because
# it's running in a different window?
without_resyncronize { click_button "Allow" }
end
end
@travis
travis / gist:1084767
Created July 15, 2011 14:16
testing facebook connect with capybara and rspec
require 'mogli'
module FacebookIntegrationHelpers
shared_context "with unconnected facebook user" do
let(:fb_user) { create_test_user(installed: false) }
after { fb_user.destroy }
end
def app_client
Mogli::AppClient.new(AppConfig.facebook.access_token, AppConfig.facebook.app_id)
@travis
travis / gist:1181205
Created August 30, 2011 15:42
open github to a repo
(defmacro github-launcher (name)
(let ((project-name name))
`(defun ,(intern (concat "gh" project-name)) ()
(interactive)
(browse-url ,(concat "http://github.com/travis/" project-name)))))
@travis
travis / macro.md
Created January 25, 2012 14:36 — forked from sritchie/macro.md

A little Clojure challenge inspired by Let over Lambda.

Write a macro (you can try a function, but it's impossible) that accepts four arguments:

  1. an expression that returns a number
  2. something to return if that number's negative
  3. something to return if that number's zero
  4. something to return if that number's positive

Here's the signature: (defmacro nif [expr neg zero pos] ...)