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 my-awesome-nampspace | |
(:refer-clojure :exclude [+])) | |
(defn + [a b] | |
(println (str a b))) | |
(+ "aaa" "bbb") |
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
#!/usr/bin/fish | |
exec gnome-session --session=xmonad-gnome "$argv" |
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
(defmacro try* | |
"Macro to catch multiple exceptions with one catch body. | |
Usage: | |
(try* | |
(println :a) | |
(println :b) | |
(catch* [A B] e (println (class e))) | |
(catch C e (println :C)) | |
(finally (println :finally-clause))) |
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
#~/.asoundrc | |
pcm.!default { | |
type pulse | |
} | |
ctl.!default { | |
type pulse | |
} |
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
#include <Adafruit_GFX.h> | |
#include <Adafruit_PCD8544.h> | |
// pin 7 - Serial clock out (SCLK) | |
// pin 6 - Serial data out (DIN) | |
// pin 5 - Data/Command select (D/C) | |
// pin 4 - LCD chip select (CS) | |
// pin 3 - LCD reset (RST) | |
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3); |
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-package :some-debugger) | |
(defun vector->list (vec) | |
(coerce vec 'list)) | |
(defun frame-file (frame) | |
(let* ((code-location (sb-di:frame-code-location frame)) | |
(dsource (sb-di:code-location-debug-source code-location))) | |
(if dsource | |
(let ((file (sb-c::debug-source-namestring dsource))) |
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
#-quicklisp | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
(ql:quickload "cl-async") | |
(defun error-handler () | |
(lambda (err) (format t "listener event: ~a~%" err))) |
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 'yaml' | |
require 'enumerator' | |
module Reducer | |
def cores_count | |
case RbConfig::CONFIG['host_os'] | |
when /darwin9/ | |
`hwprefs cpu_count`.to_i | |
when /darwin/ | |
((`which hwprefs` != '') ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i |
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
# http://stackoverflow.com/questions/2694679/how-does-the-yin-yang-puzzle-work | |
require "continuation" | |
yin = ->(cc) { print "@"; sleep 0.5; cc }.call(callcc { |cc| cc }) | |
yang = ->(cc) { print "*"; sleep 0.5; cc }.call(callcc { |cc| cc }) | |
yin.call(yang) |