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
from shet.client import ShetClient | |
# Subclass ShetClient. | |
class MyClient(ShetClient): | |
# All nodes created by this client will be relative to this directory, | |
# unless they begin with a '/'. | |
self.root = "/test/" | |
def __init__(self, dir): |
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
import Control.Monad.State | |
-- Append a string to the state. | |
string :: String -> State [String] () | |
string s = State $ \ss -> ((), ss ++ [s]) | |
-- Get the string out of the state. | |
to_str (State ss) = concat $ b | |
where (a, b) = ss [] |
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/env python2 | |
import sys | |
import shelve | |
import subprocess | |
import os | |
import pickle | |
def no_spaces(line): | |
return len(line) - len(line.lstrip()) |
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
set mouse=a | |
colorscheme jellybeans+ | |
" colorscheme vividchalk | |
set listchars=tab:⌞\ ,trail:⋅ | |
set list | |
set noexpandtab | |
set copyindent | |
set preserveindent |
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
Config { font = "xft:Monaco:pixelsize=10" | |
, bgColor = "#73642" | |
, fgColor = "#93a1a1" | |
, position = TopW L 97 | |
, commands = [ Run Cpu ["-L","3","-H","50","--normal","#859900","--high","#d30102", "-t", "<fc=#d33682>C</fc> <total>%", "-m", "2"] 10 | |
, Run Memory ["-t","<fc=#d33682>M</fc> <usedratio>%"] 10 | |
, Run Swap ["-t","<fc=#d33682>S</fc> <usedratio>%"] 10 | |
, Run Date "<fc=#d33682>D</fc> %a %b %_d %l:%M" "date" 10 | |
, Run StdinReader | |
, Run Battery |
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
import Control.Monad | |
import Data.Monoid | |
import Data.Ratio | |
import Graphics.X11.ExtraTypes.XF86 | |
import qualified Data.Map as M | |
import qualified XMonad.Layout.IM as IM | |
import qualified XMonad.StackSet as W | |
import System.IO | |
import XMonad.Actions.CycleWS | |
import XMonad.Actions.UpdatePointer |
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
#!/bin/bash | |
# Script to switch all programs to a specific sink. Why this isn't easy, i | |
# don't know. | |
# This script takes a single argument, the sink name, index, or alias (defined | |
# below). | |
# To make this work, you will need to: | |
# - In /etc/pulse/default.pa: |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout somewhen, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
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
export XAUTHORITY=/home/tom/.Xauthority | |
export DISPLAY=:0.0 |
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
import unittest | |
# A module to make writing tests that deal with asynchronous things easier. | |
def async(f): | |
"""Decorator to use on any test case that uses assertCalled or | |
assertNotCalled.""" | |
def g(self): | |
# run_after is a list of functions to run after the test case. We clear it | |
# before and after running the test case so that AsyncTestCase can see that |
OlderNewer