This file contains hidden or 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
(defun clj-repl (binary) | |
(setq swank-clojure-binary binary) | |
(require 'swank-clojure-autoload) | |
(slime)) | |
(defun pt-repl () | |
(interactive) | |
(clj-repl "~/Projects/gh/pivotal-tracker-clj/bin/slime")) |
This file contains hidden or 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
Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "lisp") | |
start-process("inferior-lisp" #<buffer *inferior-lisp*> "lisp") | |
apply(start-process "inferior-lisp" #<buffer *inferior-lisp*> "lisp" nil) | |
start-file-process("inferior-lisp" #<buffer *inferior-lisp*> "lisp") | |
apply(start-file-process "inferior-lisp" #<buffer *inferior-lisp*> "lisp" nil) | |
comint-exec-1("inferior-lisp" #<buffer *inferior-lisp*> "lisp" nil) | |
comint-exec(#<buffer *inferior-lisp*> "inferior-lisp" "lisp" nil nil) | |
(let ((process-environment ...)) (comint-exec (current-buffer) "inferior-lisp" program nil program-args)) | |
(save-current-buffer (set-buffer (get-buffer-create buffer)) (when directory (cd ...)) (comint-mode) (let (...) (comint-exec ... "inferior-lisp" program nil program-args)) (lisp-mode-variables t) (let (...) (slime-set-query-on-exit-flag proc) proc)) | |
(with-current-buffer (get-buffer-create buffer) (when directory (cd ...)) (comint-mode) (let (...) (comint-exec ... |
This file contains hidden or 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
def _get_or_instantiate(request, objclass): | |
try: | |
key = _keyify(objclass) | |
return objclass._default_manager.get(pk=session.get(request, key)) | |
except (ObjectDoesNotExist, KeyError): | |
return objclass() | |
# becomes: | |
def _get(request, objclass): |
This file contains hidden or 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
def test_refer_physician_no_caller(self): | |
signals.referral_without_caller.disconnect(alerts.referral_without_caller) | |
callback_called = Ref(False) | |
def cb(sender, **kwargs): | |
callback_called(True) | |
signals.referral_without_caller.connect(cb) | |
physician = milkman.deliver(Physician, is_active=True) | |
This file contains hidden or 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 rets | |
(:import (org.apache.http.client HttpClient) | |
(org.apache.http.client.methods HttpGet HttpPost) | |
(org.apache.http.impl.client DefaultHttpClient) | |
(org.apache.http.util EntityUtils))) | |
(use '[clojure.contrib.str-utils]) | |
(def base-url "http://rets.realtracs.net:6103") | |
(def login-path "/rets/login") |
This file contains hidden or 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
(require 'slime) | |
(slime-setup) | |
(require 'clojure-auto) | |
(require 'clojure-paredit) | |
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode)) | |
;; These are extra key defines because I kept typing them. | |
;; Within clojure-mode, have Ctrl-x Ctrl-e evaluate the last | |
;; expression. |
This file contains hidden or 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 fnord.jetty | |
(:import (javax.servlet.http HttpServletResponse) | |
(org.mortbay.jetty HttpConnection Request Response Server) | |
(org.mortbay.jetty.bio SocketConnector) | |
(org.mortbay.jetty.handler AbstractHandler))) | |
(def *dispatch-table* (ref {})) | |
(def *server* (Server.)) | |
(defstruct webctx :target :request :response :dispatch) |
This file contains hidden or 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
(comment | |
public static void main(String[] args) throws Exception | |
{ | |
Server server = new Server(); | |
Connector connector=new SocketConnector(); | |
connector.setPort(8080); | |
server.setConnectors(new Connector[]{connector}); | |
Handler handler=new HelloHandler(); | |
server.setHandler(handler); |
This file contains hidden or 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
(defun writeroom () | |
"Switches to a WriteRoom-like fullscreen style" | |
(interactive) | |
(when (featurep 'aquamacs) | |
; switch to Garamond 36pt | |
;; (set-frame-font "-apple-garamond-medium-r-normal--36-360-72-72-m-360-iso10646-1") | |
(set-frame-font "-apple-monaco-medium-r-normal--14-120-72-72-m-120-mac-roman") | |
; switch to fullscreen mode | |
(aquamacs-toggle-full-frame))) | |
This file contains hidden or 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
(defun twm-frame-full-screen-p () | |
(frame-parameter nil 'fullscreen)) | |
(defun twm-make-full-screen () | |
(when (and (featurep 'aquamacs) (not (twm-frame-full-screen-p))) | |
(aquamacs-toggle-full-frame))) |
OlderNewer