Skip to content

Instantly share code, notes, and snippets.

View jrockway's full-sized avatar

June Rockway jrockway

View GitHub Profile
has 'request_builder' => (
is => 'ro',
isa => 'CodeRef',
traits => ['Code'],
handles => { request => 'execute' },
default => sub {
my ($self) = @_;
weaken $self;
return sub {
my ($method, $uri, $headers, $cb) = @_;
@jrockway
jrockway / test.pl
Created December 13, 2011 16:05
xmms2 + powermate
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use Config;
my $event_size =
($Config{longsize} * 2) + # input_event.time (struct timeval)
($Config{i16size} * 2) + # input_event.type, input_event.code
@jrockway
jrockway / play.pl
Created December 27, 2011 08:18
Sending a transcript to a SMTP server nicely
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use autodie qw/open/;
my $file = shift;
open my $fh, '<', $file;
@jrockway
jrockway / display.c
Created August 27, 2012 08:43
driver for adafruit led backpack
#include "display.h"
#include "third_party/i2cmaster.h"
static const uint8_t number_table[] = {
0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x77, 0x7C,
0x39, 0x5E, 0x79, 0x71 };
void init_display(int address) {
i2c_start_wait(address + I2C_WRITE);
i2c_write(0x21);
@jrockway
jrockway / foo.pl
Created September 22, 2012 08:25
make a dot file out of lsmod's output
#!/usr/bin/perl -n
BEGIN { print "digraph modules {\n" }
if(/^([^[:space:]]+).*\s([^[:space:]]+)$/) {
print "# $1 -> $2\n";
for (split /,/,$2) {
print " $1 -> $_;\n";
}
}
END { print "}" }
@jrockway
jrockway / xorg.conf
Created December 5, 2013 10:11
xorg.conf for a custom EDID for my TV, making my card not send null audio over the DVI link. See also: http://analogbit.com/hdmi_dvi_audio
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
Section "Files"
backend = "glx";
glx-no-stencil = true;
refresh-rate = 60;
vsync = "opengl-swc";
paint-on-overlay = true;
sw-opti = false;
unredir-if-possible = false;
@jrockway
jrockway / diffstat
Created May 11, 2014 10:09
openbsd 5.4 to 5.5 upgrade
root/etc/boot.conf | 2 +-
root/etc/ddclient/ddclient.conf | 191 +++++++++++++++++++++++++++++++++++
root/etc/dhclient.conf | 3 +-
root/etc/dhcpd.conf | 43 ++++----
root/etc/hostname.em0 | 4 +-
root/etc/hostname.gif0 | 3 +
root/etc/hostname.tun0 | 2 +
root/etc/hostname.vr0 | 1 +
root/etc/myname | 2 +-
root/etc/openvpn/blinky.jrock.us.crt | 92 +++++++++++++++++

Keybase proof

I hereby claim:

  • I am jrockway on github.
  • I am jrockway (https://keybase.io/jrockway) on keybase.
  • I have a public key ASA8G2c4-xSAc7iQtrfm5NgCF4vmTT9M8vwzyr4YQto4tgo

To claim this, I am signing this object: