Skip to content

Instantly share code, notes, and snippets.

View spikegrobstein's full-sized avatar

spike grobstein spikegrobstein

View GitHub Profile
<?php
//Use this to tunnel a file through json for crossdomain access.
try {
$uri = $_GET['uri']; // the URI that we're fetching
$callback = $_GET['_callback']; // the callback that's used with jsonp (optional)
if (is_null($_GET['uri'])) {
throw new Exception('Bad URI');
@spikegrobstein
spikegrobstein / postgres_backup.sh
Created April 30, 2012 02:35 — forked from robertsosinski/daily.sh
PostgreSQL - Backup Util
#! /bin/bash -
####
## postgres_backup
## back up postgres on a regular basis
## USAGE:
## ./postgres_backup [ <prefix> ] [ <number_to_keep> ]
## prefix will default to 'pg'
## number_to_keep defaults to 2
##
def get_quotes(block_of_text)
lines = block_of_text.split(/\n+/)
lines.map do |line|
m = line.match(/^(.+?):\s+(.+)$/) # match the line
next unless m # skip any lines that don't look like "some name: some text"
[ m[1], m[2] ]
end.compact
end
@spikegrobstein
spikegrobstein / config
Last active March 10, 2020 18:36 — forked from dtjm/config
Wrapper to use OS X FileMerge when calling `svn diff`
### ~/.subversion/config
### Add this line to the [helpers] section
diff-cmd = ~/bin/svn-diffwrap.sh