Skip to content

Instantly share code, notes, and snippets.

David E. Wheeler theory

View GitHub Profile
View gist:306590e6ae88f9fd3d11f28092c33bc7
# Installs build dependency.
$ cpanm --quiet -L try --notest DBI
Successfully installed Test-Simple-1.302140
Successfully installed DBI-1.641
2 distributions installed
# Installs configure dependency.
$ cpanm --quiet -L try --notest Widget::Meta
Successfully installed Module-Build-0.4224
Successfully installed Widget-Meta-0.06
View Dockerfile
FROM alpine:latest
RUN apk add --update less
ENV TERM xterm-256color
ENTRYPOINT echo -e "Color me \033[31mRED" | less
View pgenv.sh
#!/bin/bash
# Versions:
# 10.4 9.6.9 9.5.13 9.4.18 9.3.23 9.2.24 9.1.24 9.0.19 8.4.22 8.3.23 8.2.23 8.1.23 8.0.26
BASE=$HOME/pg
PGSQL=$BASE/pgsql
PG_DATA=$PGSQL/data
PG_CTL="$PGSQL/bin/pg_ctl -D $PG_DATA"
View pg.patch
diff --git a/lib/App/Sqitch/Engine/pg.pm b/lib/App/Sqitch/Engine/pg.pm
index 71a8d2cc..11e55ca1 100644
--- a/lib/App/Sqitch/Engine/pg.pm
+++ b/lib/App/Sqitch/Engine/pg.pm
@@ -45,15 +45,22 @@ has _psql => (
my $self = shift;
my $uri = $self->uri;
my @ret = ( $self->client );
- for my $spec (
- [ username => $self->username ],
View plv8-centos7-output.txt
+ make PG_CONFIG=/usr/pgsql-9.4/bin/pg_config -j16
sed -e 's/^#undef PLV8_VERSION/#define PLV8_VERSION "2.1.0"/' plv8_config.h.in > plv8_config.h
echo "extern const unsigned char coffee_script_binary_data[] = {" >coffee-script.cc
echo "extern const unsigned char livescript_binary_data[] = {" >livescript.cc
sed -e 's/@PLV8_VERSION@/2.1.0/g' plv8.control.common | g++ -E -P -DLANG_plv8 - > plv8.control
sed -e 's/@LANG_NAME@/plv8/g' plv8.sql.common | sed -e 's/@PLV8_VERSION@/2.1.0/g' | g++ -E -P -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -DLANG_plv8 - > plv8--2.1.0.sql
sed -e 's/@PLV8_VERSION@/2.1.0/g' plv8.control.common | g++ -E -P -DLANG_plcoffee - > plcoffee.control
sed -e 's/@LANG_NAME@/plcoffee/g' plv8.sql.common | sed -e 's/@PLV8_VERSION@/2.1.0/g' | g++ -E -P -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -DLANG_plcoffee - > plcoffee--2.1.0.sq
@theory
theory / reversion.pl
Created Jul 17, 2017
Simple script to update the version of a Perl distribution.
View reversion.pl
#!/usr/bin/perl -pi
BEGIN {
die "Usage: $0 version[, new_version]\n\n" unless @ARGV;
$old = shift;
$new = shift || sprintf('%.2f', $old + .01);
$dir = shift || '.';
@ARGV =
map { print; chomp; $_ }
@theory
theory / golc.pl
Last active Jun 10, 2017
My dumb Go source code line counter.
View golc.pl
#!/usr/bin/env perl -w
use warnings;
use utf8;
use strict;
use File::Find qw(find);
push @ARGV, '.' unless @ARGV;
my $go_comments = 0;
View try.sql
create table mass_email_recipients (
id integer,
mass_email_send_id integer,
status integer
);
insert into mass_email_recipients
values (240, 154, 1),
(241, 154, 1),
(241, 154, 0);
View reset-sqitch-registry.pl
#!/usr/bin/env perl
use v5.10;
use strict;
use warnings;
use URI;
=pod
=head1 Name
View gist:200ebab19c7959d8f9ae
$ echo $DYLD_LIBRARY_PATH
/usr/local/instantclient_11_2
$ perl -E 'say $ENV{DYLD_LIBRARY_PATH}'
You can’t perform that action at this time.