Skip to content

Instantly share code, notes, and snippets.

View nheinric's full-sized avatar

Nathaniel Heinrichs (nheinric) nheinric

View GitHub Profile
@nheinric
nheinric / com.nheinric.hubot.plist
Last active April 19, 2016 18:59
Hubot .plist for running via launchctl on OSX
<?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>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.nheinric.hubot</string>
<!-- LSEnvironment does not work for PATH. I don't know why.
https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-106825
@nheinric
nheinric / makefile-to-cpanfile.pl
Last active December 17, 2015 18:49
Quick script to convert Makefile.PL to cpanfile format for use with carton
#!/usr/bin/env perl
use common::sense;
use Scalar::Util qw(looks_like_number);
my $MAKEFILE = $ARGV[0] or die "Usage: $0 /full/path/to/Makefile.PL";
open( my $fh, '<', "$MAKEFILE" ) or die "Cant open $MAKEFILE";
my %requirements;
my $q = qr{['"]};
my $nq = qr{[^'"]};
@nheinric
nheinric / pre-commit
Created April 27, 2012 03:55
My git pre-commit hook
#!/usr/bin/env perl
use strict;
use warnings;
use MIME::Base64;
my $AGAINST = "HEAD";
`git rev-parse --verify HEAD >/dev/null 2>&1`;
$? and $AGAINST = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; # Initial commit
my $filename_regex = qr{^\+\+\+ b(.+)};