Every stream has two basic parts
- data-in - A chunk or EOF enters the stream
- data-out - A chunk or EOF leaves the stream
I'm combining both "data" and "end" events since "end" is just a special data packet signifying the end of the stream.
# Originally from https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Enable the 2D Dock | |
defaults write com.apple.dock no-glass -bool true | |
# Disable menu bar transparency | |
defaults write -g AppleEnableMenuBarTransparency -bool false | |
# Expand save panel by default | |
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true |
#!/bin/sh | |
# This script takes a photo if the computer has not been idle for longer than a period of time | |
# it uses isightcapture from https://www.macupdate.com/app/mac/18598/isightcapture | |
[ -z "$USER" ] && echo "missing variable \$USER " && exit 1 | |
if [ ! -d /Users/$USER/daily_photo ]; then | |
mkdir -p $/Users/$USER/daily_photo | |
fi | |
IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 )) | |
export SUDO_ASKPASS=/Users/$USER/bin/get_pass.sh |
// Extracted from http://www.w3.org/TR/dom/ | |
// Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). | |
// Some Rights Reserved: this document is dual-licensed, CC-BY and W3C Document License. | |
// W3C liability, trademark and document use rules apply. | |
exception DOMException { | |
const unsigned short INDEX_SIZE_ERR = 1; | |
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical | |
const unsigned short HIERARCHY_REQUEST_ERR = 3; | |
const unsigned short WRONG_DOCUMENT_ERR = 4; |
require 'yaml' | |
Track = Struct.new :title, :duration | |
# An Album represents an audio medium which has title, | |
# interpret, a pause duration between tracks and a list | |
# of individual tracks. | |
class Album | |
attr_reader :title, :interpret, :pause |
$ git clone https://gist.github.com/8b4404e538e61c7996a5.git | |
$ cd 8b4404e538e61c7996a5 | |
$ mkdir salamander && cd salamander | |
$ curl -L -O https://archive.org/download/SalamanderDrumkit/salamanderDrumkit.tar.bz2 | |
$ curl -L -O https://github.com/johnsen/drumsandpercussion/blob/master/SalamanderKick/salamanderdrum-kick-r1.tar.gz | |
$ curl -L -O http://freepats.zenvoid.org/Piano/SalamanderGrandPianoV3_44.1khz16bit.tar.bz2 | |
$ tar xvfz salamanderDrumkit.tar.bz2 | |
$ tar xvfz salamanderdrum-kick-r1.tar.gz | |
$ mv Kick/kick* OH/ | |
$ tar xvfz SalamanderGrandPianoV3_44.1khz16bit.tar.bz2 |
pre.code { background: #181818; padding: 16px; color: #F8F8F8; font-family: Consolas, Monaco,"Lucida Console"; } | |
pre.code * { font-family: Consolas, Monaco,"Lucida Console"; } | |
pre.code .hll { background-color: #ffffcc } | |
pre.code .c { color: #5F5A60; font-style: italic } /* Comment */ | |
pre.code .err { border:#B22518; } /* Error */ | |
pre.code .k { color: #CDA869 } /* Keyword */ | |
pre.code .cm { color: #5F5A60; font-style: italic } /* Comment.Multiline */ | |
pre.code .cp { color: #5F5A60 } /* Comment.Preproc */ | |
pre.code .c1 { color: #5F5A60; font-style: italic } /* Comment.Single */ | |
pre.code .cs { color: #5F5A60; font-style: italic } /* Comment.Special */ |
In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.
For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.