Skip to content

Instantly share code, notes, and snippets.

View 2shortplanks's full-sized avatar

Mark Fowler 2shortplanks

View GitHub Profile
@2shortplanks
2shortplanks / Low Battery Alert.kmmacros
Created February 5, 2014 23:23
Keyboard Maestro Macro to pop open a big dialog when you're about to run out of power (rather than OSX 10.9's small notification)
<?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">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
mark@travis-5:~$ perl find2.pl /usr/share/dict/words
acalycine calycine calcine alcine aline line lie ie i
acalycine calycine calcine alcine aline line lie li i
acalycine calycine calcine alcine aline line lin in i
acalycine calycine calcine alcine aline line lin li i
acalycine calycine calcine alcine aline alin lin in i
acalycine calycine calcine alcine aline alin lin li i
acalycine calycine calcine alcine aline alin aln an a
acalycine calycine calcine alcine aline alin aln al a
acaridean caridean caridea carida carid arid rid id i
@2shortplanks
2shortplanks / dataprinterfatpack.pl
Created April 14, 2014 21:57
Fatpacked Data Printer
#!/usr/bin/perl
# This chunk of stuff was generated by App::FatPacker. To find the original
# file's code, look for the end of this BEGIN block or the string 'FATPACK'
BEGIN {
my %fatpacked;
$fatpacked{"Clone/PP.pm"} = <<'CLONE_PP';
package Clone::PP;
try {
assert.deepEqual(record,result);
success = true;
} catch (e) {}
if (success) {
console.log("ok "+i);
} else {
console.log("not ok "+i);
console.log("# got: ");
@2shortplanks
2shortplanks / gist:da718370e8ca78efa396
Created October 14, 2014 18:08
Problem with Mojo::DOM and <dl>...</dl>
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use Mojo::DOM;
my $string = <<'ENDHTML';
<dl>
@2shortplanks
2shortplanks / gist:1311a130cc4738550876
Last active August 29, 2015 14:07
CSS selector problem with Mojo::DOM and dd
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 2;
use Mojo::DOM;
# passes
{
@2shortplanks
2shortplanks / gist:51ef17828821a9a46974
Created October 17, 2014 17:07
Pg inserting weirdness
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use Test::More;
{
my $dbh = DBI->connect("dbi:Pg:dbname=circonus;host=wdb3;port=5490",$ENV{USER},$ENV{PASSWORD}, {
#!/usr/bin/env perl
########################################################################
# Do actions (e.g. notify me) when someone says something in HipChat
########################################################################
use 5.0016;
use strict;
use warnings;
* 300. Green Day, American Idiot (Reprise, 2004)
* 299. Parquet Courts, Sunbathing Animal (What’s Your Rupture?, 2014)
* 298. Ice Cube, AmeriKKKa’s Most Wanted (Priority, 1990)
* 297. Gorillaz, Demon Days (Virgin, 2005)
* 296. Various Artists, Total 4 (Kompakt, 2002)
* 295. Old 97’s, Too Far to Care (Elektra, 1997)
* 294. Sigur Rós, Ágætis Byrjun (Play It Again Sam, 1999)
* 293. Garbage, Version 2.0 (EastWest/Warner Bros., 1998)
* 292. Usher, Looking 4 Myself (RCA, 2012)
* 291. The Hold Steady, Separation Sunday (Frenchkiss, 2005)
2Pac
A Tribe Called Quest
Aaliyah
Aerosmith
Against Me!
Air
Amy Winehouse
Animal Collective
Aphex Twin
Arcade Fire