Skip to content

Instantly share code, notes, and snippets.

Randal L. Schwartz RandalSchwartz

Block or report user

Report or block RandalSchwartz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View roman-time.pl
#!/usr/bin/env perl
use strict;
use Roman;
my @time = localtime;
my @result;
my $hours = $time[2];
my $past = $hours > 11 ? "noon" : "midnight";
$hours %= 12;
@RandalSchwartz
RandalSchwartz / pre-receive.sh
Created Feb 1, 2012
My pre-receive hook to update my website when I "git push origin master:live"
View pre-receive.sh
#!/bin/sh
while read old new branch
do
case "$new-$branch" in
000000000000000000*)
: echo "ignore deleted"
;;
*-refs/heads/live )
echo "UPDATING LIVE SITE";
git archive $new | (
@RandalSchwartz
RandalSchwartz / gist:2220568
Created Mar 27, 2012
Finding Git.pm regardless of where your packager decided it should be
View gist:2220568
#!/usr/bin/perl
use strict;
use lib $ENV{GITPERLLIB}
? split(/:/, $ENV{GITPERLLIB})
: do {
chomp(my $exec_path = qx{git --exec-path});
open my $gitsvn, "<", "$exec_path/git-svn" or die "Cannot find git-svn";
{
last unless local $_ = readline $gitsvn;
You can’t perform that action at this time.