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
(require 'pc-select) | |
(defun slime-update-clojure-namespace () | |
"Find the namespace in the current buffer and use SLIME's REPL | |
to switch to it, updating the namespace for all buffers." | |
(interactive) | |
(save-excursion | |
;; search for this buffer's namespace: | |
(goto-char 0) | |
(when (search-forward "(ns " nil t) | |
(let ((beg (point)) |
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
# In reply to my own question | |
# (http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/#comment-69995567) | |
# about using git-flow with existing git repos I experimented with a dummy | |
# git repo and it appears rather straight-forward | |
kold@Macintosh-27 $ git init test_git_flow | |
Initialized empty Git repository in /private/tmp/test_git_flow/.git/ | |
(/tmp) | |
kold@Macintosh-27 $ cd test_git_flow/ |
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
(defun lisp-enable-paredit-hook () (paredit-mode 1)) | |
(add-hook 'clojure-mode-hook 'lisp-enable-paredit-hook) | |
(defmacro defclojureface (name color desc &optional others) | |
`(defface ,name '((((class color)) (:foreground ,color ,@others))) ,desc :group 'faces)) | |
(defclojureface clojure-parens "DimGrey" "Clojure parens") | |
(defclojureface clojure-braces "#49b2c7" "Clojure braces") | |
(defclojureface clojure-brackets "SteelBlue" "Clojure brackets") | |
(defclojureface clojure-keyword "khaki" "Clojure keywords") |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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 dining-service | |
(:use aleph.core) | |
(:use aleph.http) | |
(:use net.cgrand.moustache) | |
) | |
(defn report-handler [response-channel request] | |
(enqueue response-channel | |
{:status 200 | |
:headers {"content-type" "text/plain"} |
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 wl.core | |
(:use compojure.core, aleph.core, aleph.http, hiccup.core, hiccup.page-helpers) | |
(:require [compojure.route :as route]) | |
(:gen-class)) | |
(def broadcast-channel (channel)) | |
(defn chat-handler [ch handshake] | |
(receive ch | |
(fn [name] |
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
Set AppObj = CreateObject("Shell.Application") | |
If WScript.Arguments.Length=1 Then | |
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """" | |
Else | |
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash""" | |
End If |
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
# -*- coding: utf-8 -*- | |
""" | |
Run as a supervisor event listener process. See http://supervisord.org/events.html for more info. | |
An example eventlistener config block looks like: | |
[eventlistener:myeventhandler] | |
command=python /path/to/eventriloquist.py | |
events=EVENT |
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
from MySQLdb.cursors import SSDictCursor | |
def iterate_query(query, connection, arraysize=1): | |
c = connection.cursor(cursorclass=SSDictCursor) | |
c.execute(query) | |
while True: | |
nextrows = c.fetchmany(arraysize) | |
if not nextrows: | |
break |
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
import yaml | |
import yaml.constructor | |
try: | |
# included in standard lib from Python 2.7 | |
from collections import OrderedDict | |
except ImportError: | |
# try importing the backported drop-in replacement | |
# it's available on PyPI | |
from ordereddict import OrderedDict |