View solr-exporter.sh
#!/bin/bash | |
SOLRJOB=$1 | |
SOLRHOST=$2 | |
if [[ $SOLRJOB == "" || $SOLRHOST == "" ]] ; then | |
echo 'Usage: solr-exporter.sh SOLRJOB SOLRHOST' | |
echo ' Ex: solr-exporter.sh solrdev volley.flr.follett.com' | |
exit 1 | |
fi |
View gist:bb4482751f477b64c3d11ff6d143c89d
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use 5.010; | |
use Test::More 'no_plan'; | |
use Test::Deep qw( cmp_bag ); |
View trunkdiff-files
#!/usr/bin/env python3 | |
import os | |
import re | |
status = re.compile('^(\\+\\+\\+|---) \\s+ ([^\t]+) \t .+ \t \\((.+?)\\)$', re.X) | |
deletes = [] | |
adds = [] | |
diffs = [] |
View prompt.sh
#!/bin/bash | |
# Adapted from from https://github.com/hoelzro/bashrc/blob/master/colors.sh | |
function __prompt | |
{ | |
local EXIT="$?" # Stash the exit status for later. | |
# List of color variables that bash can use | |
local BLACK="\[\033[0;30m\]" # Black |
View .vimrc
"============================================================================ | |
" General settings | |
"---------------------------------------------------------------------------- | |
set nocompatible " nocp: turn off vi compatibility | |
set undolevels=1000 " ul: lots and lots of undo | |
set history=50 " hi: size of :command history | |
set modelines=20 | |
set modeline " ml: Turn on modelines | |
set backup " keep a backup file |
View Functional.pm
package TW::Functional; | |
=head1 NAME | |
TW::Functional -- functions for helping write more functional code | |
=head1 WARNING | |
This module must contain no TW-specific code. These are purely abstract functions. |
View service.js
// service.js -- Reports back the ISBNs in a the given ISBN's family. | |
'use strict'; | |
const oracledb = require('oracledb'); | |
const http = require('http'); | |
const url = require('url'); | |
const hostname = 'hostname.com'; | |
const port = 42000; |
View splitdump.py
#!/usr/bin/env python | |
# Python version of https://gist.github.com/petdance/a147f8da9d2afde593382321c07dd2d1 | |
import csv | |
import string | |
def create_sql(): | |
return ''' | |
DROP TABLE IF EXISTS response; | |
DROP TABLE IF EXISTS reasons; |
View splitdump.pl
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use 5.010; | |
use Text::CSV_XS; | |
my $csv = Text::CSV_XS->new; |
View counts.sql
/* The MariaDB I installed doesn't support CTEs, so use a subquery */ | |
SELECT * FROM ( | |
select | |
reason, | |
SUM( CASE WHEN gender = 'Male' THEN 1 END) as M, | |
SUM( CASE WHEN gender = 'Female' THEN 1 END) as F, | |
SUM( CASE WHEN gender NOT IN ('Male','Female') THEN 1 END) AS X, | |
COUNT(gender) AS T | |
from response | |
inner join reasons on reasons.responseid = response.responseid |
NewerOlder