Skip to content

Instantly share code, notes, and snippets.

View chizmw's full-sized avatar

Chisel Malik-Wright chizmw

View GitHub Profile
@chizmw
chizmw / test_err.t
Created September 17, 2011 20:41
test_err() experimentation
use Test::More;
use strict;
use warnings;
use Test::Builder::Tester;
test_out("not ok 1 - foo");
test_fail(+1);
fail("foo");
test_test("fail works");
@chizmw
chizmw / cmd_availability.pl
Created September 21, 2011 09:32
irssi plugin to munge nick and away message, preserving base nick
#!/usr/bin/env perl
# Usage: /AVAILABILITY [here|lunch|meeting]
sub cmd_availability {
# data - contains the parameters for /HELLO
# server - the active server in window
# witem - the active window item (eg. channel, query)
# or undef if the window is empty
my ($data, $server, $witem) = @_;
@chizmw
chizmw / cmd_availability.pl
Created July 24, 2012 11:06
irssi 'availability' plugin script
#!/usr/bin/env perl
# Usage: /AVAILABILITY [here|lunch|meeting]
sub cmd_availability {
# data - contains the parameters for /HELLO
# server - the active server in window
# witem - the active window item (eg. channel, query)
# or undef if the window is empty
my ($data, $server, $witem) = @_;
@chizmw
chizmw / .gitignore
Created August 13, 2012 19:54
MooseX::Types::Structured validation example
*.sw?
@chizmw
chizmw / odd_behaviour.t
Created August 16, 2012 13:39
Strange type checking behaviour
package My::Class;
use strict;
use warnings;
use Moose;
use MooseX::AttributeHelpers;
use MooseX::Types::Moose qw/ArrayRef Int/;
use MooseX::Types -declare => [qw(Thingy ThingyList)];
subtype Thingy,
@chizmw
chizmw / cmd_availability.pl
Last active December 10, 2015 23:28
An irssi plugin that makes it easier to change your nick and away status to make your availability really obvious (used at $work)
#!/usr/bin/env perl
# An irssi plugin that makes it easier to change your nick and away status to
# make your availability really obvious (used at $work)
#
# Simple examples are:
# gone --> gone = "/availability gone";
# idme = "/msg NickServ IDENTIFY s3kritw0rd";
# here --> here = "/availability here; /idme";
@chizmw
chizmw / cmp_versions.pl
Created January 30, 2013 23:31
Comparing some version numbers for a post on http://blogs.perl.org/users/chisel
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.12';
use version;
use Text::SimpleTable;
my @versionstrings = (
'0.0.4',
@chizmw
chizmw / copy_db.java
Created July 17, 2013 14:23
Extending Wheeler's example for copying a sqlite3 database to somewhere accessible (and examinable)
public void copy_db() {
// copy the db to the sdcard
try {
File sd = Environment.getExternalStorageDirectory();
if (sd.canWrite()) {
String currentDBPath = this.myContext.getDatabasePath(this.getDatabaseName()).toString();
// use out package as the place to store files
String backupDirectory = "/" + this.myContext.getPackageName();
@chizmw
chizmw / git-aliases
Created November 13, 2013 17:14
A bash script that ensures all my git aliases are set-up as I like them
#!/usr/bin/env bash
# vim: ts=8 sts=4 et sw=4 sr sta
# only do the updates if this file is newer than our git config file
# (that means we've some something here)
if test $BASH_SOURCE -nt $HOME/.gitconfig; then
echo "[Updating git aliases...]";
# exit immediately if we have the lockfile
if [ -f $HOME/.bashrcd.gitalias.lock ]; then

The World Cup Graph

Initial Data Setup