Skip to content

Instantly share code, notes, and snippets.

View toroidal-code's full-sized avatar

Katherine Whitlock toroidal-code

  • New York
View GitHub Profile
@toroidal-code
toroidal-code / Hyper.md
Last active December 31, 2023 19:32
Have you a Hyper for Great Good

Have you Hyper for Great Good

So. You have become an Emacs wizard. And you find yourself aching for the simplicity that another modifier key would introduce into your life. Ah, the things you could do with Hyper.

Or maybe, you just want Hyper for another reason.

... Except everywhere you look, everyone's talking about .xmodmaps and xkbcomp, but you're using one of those fancy desktop managers. (Aka, not awesome, dwm, xmonad or something even more hipster) And because of that, you're lost in the sea of confusion that is trying to customize your keyboard mapping.

Gnome, Cinnamon, and KDE all use xkb.

extern crate sync;
use sync::mutex::{Mutex,Guard};
use std::task;
fn lock<'a>(l0 : &'a Mutex, l1 : &'a Mutex) -> (Guard<'a>, Guard<'a>) {
loop {
't0: for _ in range(0u, 1u) {
let u0 = l0.lock();
let u1 = match l1.try_lock() {
None => {
type 'a btree =
| Leaf of 'a
| Branch of ('a btree) * ('a btree)
let rec flatten = function
| Leaf(a) -> [a]
| Branch(r, l) -> flatten r @ flatten l
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
struct Runnable {
virtual ~Runnable(){};
virtual int operator()() = 0;
### Makefile ---
##
## Filename: Makefile
## Description: A generic C Makefile
## Author: Katherine Whitlock - toroidalcode
## Created: Tue Jun 24 17:45:43 2014 (-0400)
## Version: 0.1
######################################################################
##
### Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Background Color</key>
<dict>
<key>Red Component</key>
<real>0.0627450980392157</real>
<key>Blue Component</key>
<real>0.0627450980392157</real>

Keybase proof

I hereby claim:

  • I am toroidal-code on github.
  • I am toroidalcode (https://keybase.io/toroidalcode) on keybase.
  • I have a public key whose fingerprint is 49F9 C159 4EC7 2DB0 F9DB AD2D 6034 95F2 EEDA 7602

To claim this, I am signing this object:

@toroidal-code
toroidal-code / pacat.c
Created February 4, 2014 05:54
PulseAudio example with callbacks
/***
This file is part of PulseAudio.
Copyright 2004-2006 Lennart Poettering
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
function rand(min, max) {
return parseInt(Math.random() * (max-min+1), 10) + min;
}
function get_random_color() {
var h = rand(1, 360); // color hue between 1 and 360
var s = 58; // saturation 30-100%
var l = 32; // lightness 30-70%
return 'hsl(' + h + ',' + s + '%,' + l + '%)';
}
#! /usr/bin/env python2
from PyZ3950 import zoom # ZOOM is the protocol
from pymarc import MARCReader # This is for easily dealing with USMARC data
from pyx import * # This is for exporting EPS/PDF
import os # for calling lpr
unit.set(xscale=1.5) # Text scale for pyx
conn = zoom.Connection('z3950.loc.gov', 7090) # Which server to connect to with ZOOM #albert.rit.edu, 210
conn.databaseName = 'VOYAGER' # Which database to use #innopac