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
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Aeson | |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Monad (mzero) | |
import Network.HTTP.Conduit | |
import Data.ByteString.Lazy.Internal (ByteString(..)) | |
data Item = Item { title :: String | |
, url :: String |
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
docker run -v /lib64:/lib64 -v /usr/bin/docker:/usr/bin/docker -v /run/docker.sock:/run/docker.sock -i -t ubuntu:14.04 /bin/bash | |
# lib64 is specific for opensuse 13.1 |
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
class Future | |
include java.util.concurrent.Callable | |
@@executor = java.util.concurrent.Executors::newFixedThreadPool(5) | |
def initialize(&block) | |
@block = block | |
end | |
def on_success(&block) |
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
#/etc/X11/xorg.conf.d/10-evdev.conf | |
Section "InputClass" | |
Identifier "Marble Mouse" | |
MatchProduct "Logitech USB Trackball" | |
MatchIsPointer "on" | |
MatchDevicePath "/dev/input/event*" | |
Driver "evdev" | |
# Physical button #s: A b D - - - - B C b = A & D simultaneously; - = no button | |
# Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" |
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
# 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) |
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 '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 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
#-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 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
(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 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
#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 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
#~/.asoundrc | |
pcm.!default { | |
type pulse | |
} | |
ctl.!default { | |
type pulse | |
} |