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
;; A small self applicable scheme->llvm compiler.
;; , Tobias Nurmiranta
;;
;; -- To Use It --
;; Reads scheme-code from standard input.
;; cat code.ss|mzscheme --script compile.ss|llvm-as -f -o=test.bc;lli test.bc
;;
;; The compiler is painfully slow since it for testing purposes
;; compiles all help functions as well (see variable bootstrap).
;; It extends standard scheme with a subset of available
require 'octokit'
require 'colorize'
print 'GitHub username: '
username = $stdin.gets.strip
repos = Octokit.repos(username, {type: 'public'}).map { |repo| repo['full_name'] }
puts 'Searching for license files...'
require 'nokogiri'
require 'open-uri'
def next_node_with(current, attribute, cond)
while current && current.send(attribute) != cond
current = current.next
end
current
#!/usr/bin/env ruby
require 'highline/import'
require 'colorize'
l_tag_regex = /(^\[[\w-]+\]\s*|_-_THORA\s*)/ #/^\[[\w-]+\]\s*/ #Remove sub group tag. THORA gets a special case
t_tag_regex = /\s*\[\w{8}\]$/ # match [A71160AA]-formatted trailing tags (CRC32)
e_tag_regex = /((\[|\()(?!\d{4}\)).*?(\]|\)))/ # Don't match (year), but match [1080p,etc.] or (1080p, etc.);
# will also exclude match of [year) #TODO: Fix this
class Rename
#! /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
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 + '%)';
}
@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.

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:

<?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>
### 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: