Skip to content

Instantly share code, notes, and snippets.

View william-ml-leslie's full-sized avatar

William ML Leslie william-ml-leslie

View GitHub Profile
#!/bin/sh
/usr/bin/firefox -app /home/wleslie/applications/conkeror/application.ini
@william-ml-leslie
william-ml-leslie / .stumpwmrc
Created December 31, 2016 06:12
StumpWM configuration on the X1 Carbon
(load-module "battery-portable")
(setf *screen-mode-line-format* "%B [%n] %w")
;;(setf *screen-mode-line-format*
;; (list "[%n] %w | "
;; '(:eval (run-shell-command "date" t))))
(toggle-mode-line (current-screen) (current-head))
;; Caps -> Ctrl on machines that don't do it by default
;;(run-shell-command "xmodmap -e 'clear Lock' -e 'add control = Caps_Lock'")
if data['supplemental_data']
sum = {}
data['supplemental_data'].each_pair do |key, value|
sum[key] = value.values
end
sum
else
{}
end
#!/usr/bin/env python
import sys, os, time
from subprocess import Popen, call
KEYBD = ("ephyr,,,xkbmodel=pc105,xkblayout=us,"
"xkbvariant=dvorak,xkboptions=ctrl:nocaps")
USAGE = """
Usage: %s options [command [arg...]]
@william-ml-leslie
william-ml-leslie / keyboard.rst
Last active August 29, 2015 14:25
A Better DOM Keyboard API

A better DOM keyboard API

Author

William ML Leslie <william.leslie.ttg@gmail.com>

Date

$Date 2015-07-27 15:21:08 +1000 (Mon, 27 Jul 2015) $

Copyright

This document has been placed in the public domain.

The current DOM keyboard API has a lot of flexibility, but is lacking in a few important ways. Some of those ways have been partially

@william-ml-leslie
william-ml-leslie / control.py
Created August 9, 2012 04:09
App-level dataflow
NO_RETURN = set(dis.opmap[name] for name in """
JUMP_ABSOLUTE JUMP_FORWARD RAISE_VARARGS STOP_CODE RETURN_VALUE
BREAK_LOOP""".split())
def decode_code(offset, code):
opcode = ord(code[offset])
if opcode >= dis.HAVE_ARGUMENT:
oparg = ord(code[offset + 1]) + ord(code[offset + 2])
return opcode, oparg, offset + 3
return opcode, 0, offset + 1