Skip to content

Instantly share code, notes, and snippets.

View theory's full-sized avatar
💭
🥃

David E. Wheeler theory

💭
🥃
View GitHub Profile
FROM alpine:latest
RUN apk add --update less
ENV TERM xterm-256color
ENTRYPOINT echo -e "Color me \033[31mRED" | less
#!/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"
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 ],
+ 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 July 17, 2017 18:37
Simple script to update the version of a Perl distribution.
#!/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 June 10, 2017 06:03
My dumb Go source code line counter.
#!/usr/bin/env perl -w
use warnings;
use utf8;
use strict;
use File::Find qw(find);
push @ARGV, '.' unless @ARGV;
my $go_comments = 0;
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);
#!/usr/bin/env perl
use v5.10;
use strict;
use warnings;
use URI;
=pod
=head1 Name
$ echo $DYLD_LIBRARY_PATH
/usr/local/instantclient_11_2
$ perl -E 'say $ENV{DYLD_LIBRARY_PATH}'
Processing hints file hints/darwin.pl
Generating a Unix-style Makefile
Writing Makefile for B
Running Mkbootstrap for B ()
chmod 644 "B.bs"
"../../miniperl" "-I../../lib" "-I../../lib" "../../lib/ExtUtils/xsubpp" -typemap "../../
cc -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/u
rm -f ../../lib/auto/B/B.bundle
env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib -
\