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 dss/clojure-ignore-form () | |
"Inserts, toggles, or moves Clojure's #_ ignore-next-form reader macro." | |
(interactive) | |
(flet ((in-string-p () (eq 'string (syntax-ppss-context (syntax-ppss)))) | |
(in-comment-p () (eq 'comment (syntax-ppss-context (syntax-ppss))))) | |
(skip-chars-forward " ") | |
(while (in-string-p) | |
(backward-char)) | |
(cond | |
;; switch from a comment to an ignore form, if paredit is enabled |
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 'ibuffer) | |
(defalias 'list-buffers 'ibuffer) | |
(require 'ibuffer-vc) | |
(setq ibuffer-formats | |
'( | |
(mark dss-modified vc-status-mini " " | |
(name 35 35 :left :elide) | |
;; " " (mode 10 10 :left :elide) | |
" " filename-and-process) |
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
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. | |
from AppKit import NSApplication, NSApp | |
from Foundation import NSObject, NSLog | |
from Cocoa import NSEvent, NSKeyDownMask | |
from PyObjCTools import AppHelper | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, notification): | |
mask = NSKeyDownMask |
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
;; My good-enough glomming together of clojure.test and test.generative | |
(ns cemerick.generative | |
(:require [clojure.test.generative.generators :as gens] | |
[clojure.test.generative :as gen]) | |
(:use clojure.test)) | |
;; Too bad last-report isn't sent an action upon success as well. | |
;; Perhaps this should just be replaced with a try/catch/rethrow | |
;; around the body in defspectest |
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
#!/bin/bash | |
# | |
# Template script for generating ubuntu container for LXC with the same | |
# ubuntu relase as the host | |
# | |
# This script is based on lxc-debian for EC2 (Daniil Kulchenko <daniil@kulchenko.com>) | |
# wich itself is based on lxc-debian (Daniel Lezcano <daniel.lezcano@free.fr>) | |
# |
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
var system = require('system'), | |
captureUrl = 'http://localhost:1111/capture'; | |
if (system.args.length==2) { | |
captureUrl = system.args[1]; | |
} | |
var captured = false; | |
var locked = false; | |
var captureAttempts = 0; | |
var page = new WebPage(); |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE ExistentialQuantification #-} |
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
;; ## Changes from cljs.repl.browser | |
;; | |
;; * Multiple concurrent browser-REPLs can be safely used | |
;; * The browser-REPL's HTTP server is now always-on | |
;; * Each browser-REPL session supports a new top-level "entry" URL that | |
;; can be used to easily start the REPL in a browser or other JS runtime | |
;; (i.e. you don't need to have a separate webapp running to initiate the | |
;; browser-REPL connection) | |
;; * The entry (and REPL) URLs are available in slots on the browser-REPL's | |
;; environment, making it trivial to automate browser-REPL sessions |
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
2.0 (Oct 12, 2007) | |
!!!THIS RELEASE REQUIRES RECOMPILATION OF ALL COMPILED CHEETAH TEMPLATES!!! | |
- fixed exception handling issue in the C implemenation of NameMapper | |
[patch from Eric Huss] | |
- fixed filtering of #included subtemplates | |
[patch from Brian Bird] | |
See the release notes from 2.0b1-5 and 2.0rc1-8 for other changes since |
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
Lazy, infinite recursive sequences in Bash (like in Haskell, if you squint). | |
I was inspired by the beautiful Haskell zipWith implementation of the Fibonacci sequence `fibs = 0 : 1 : zipWith (+) fibs (tail fibs)` | |
to find an equivalent in bash using 'coroutines' and recursive pipes. | |
My original experiments were https://twitter.com/tavisrudd/status/367164339716751360 | |
"fun w/ recursive pipes: e=echo;mkfifo fib;{ $e 0 1 1 >fib &};{ while read i j k; do $e $i >&2; $e $j $k $(($j+$k));sleep .4; done;}<fib>fib" | |
and https://twitter.com/tavisrudd/status/367142071489937408 | |
"o=ouro;b=boros;mkfifo $o$b;e=echo; { $e $o > $o$b & }; { while read s;do $e $s>&2;case $s in $o)$e $b;;*)$e $o; esac; done; }<$o$b >$o$b" |