most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <netj@sparcs.org> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
#!/usr/bin/ruby | |
# | |
# This script fixes /usr/local only. | |
# | |
# 6th January 2010: | |
# Modified the script to just fix, rather than install. - rpavlik | |
# | |
# 30th March 2010: | |
# Added a check to make sure user is in the staff group. This was a problem | |
# for me, and I think it was due to me migrating my account over several |
var events = require('events'), | |
util = require('util'); | |
var MockReadWriteStream = helpers.MockReadWriteStream = function () { | |
// | |
// No need to do anything here, it's just a mock. | |
// | |
}; | |
util.inherits(MockReadWriteStream, events.EventEmitter); |
machine github.com | |
login technoweenie | |
password SECRET | |
machine api.github.com | |
login technoweenie | |
password SECRET |
/* contravariance required so Empty can be used with Nodes ( Nothing <: T ) */ | |
class Tree[+T] | |
case object Empty extends Tree[Nothing] | |
case class Node[T](val elem: T, val left: Tree[T], val right: Tree[T]) extends Tree[T] | |
def inOrder[T](t: Tree[T]): List[T] = t match { | |
case Empty => Nil | |
case Node(e, left, right) => inOrder(left) ::: List(e) ::: inOrder(right) | |
} |
var fs = require('fs') | |
var events = require('events') | |
var util = require('util') | |
var path = require('path') | |
var FsPool = module.exports = function(dir) { | |
events.EventEmitter.call(this) | |
this.dir = dir; | |
this.files = []; | |
this.active = []; |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
def run_seq(cmd): | |
"""Run `cmd` and yield its output lazily""" | |
p = subprocess.Popen( | |
cmd, shell=True, | |
stdin=subprocess.PIPE, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) | |
# make STDIN and STDOUT non-blocking | |
fcntl.fcntl(p.stdin, fcntl.F_SETFL, os.O_NONBLOCK) |