Skip to content

Instantly share code, notes, and snippets.

View georgebrock's full-sized avatar

George Brocklehurst georgebrock

View GitHub Profile
@georgebrock
georgebrock / Info.plist
Last active June 22, 2024 07:52
AppleScript to handle URLs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<!-- Add this section: -->
<key>CFBundleURLTypes</key>
<array>
<dict>
@georgebrock
georgebrock / id_rsa.pub
Created December 2, 2015 12:43
George's public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAoBIrECXbiMv9B3XCYFZ6yxOCyF/aYfAuLs1ibgFCUCpxm05mIkpQhoxdRUCn8q4v/QkbzO8DNVkMDlZQ+slDjG/XB5XPZeG15tHVWul5GzPeqLK116O9Sc6Nw2lZqLgrBo93hiOlZoG7jnEMFgkVsaZs+sGR/CBl+lY146LQoXDTfAeZgT33Rw2HmXFTAnIpq0TIM2WQTU2TKzCJteN1CrlTyWu79q4zyZGXpFM4wm+s3cdrX5cPTiAGOhHQer8SCGybKx7WiGN33ahGxv1cDgEhlSt2V5N9bdNVIugOhoILX6Kj0NQ2yFx595WqRjCoYtsw2FBw82rXc1TjK/VIpQ== [email protected]
@georgebrock
georgebrock / export.sql
Last active August 31, 2021 04:40
Hockeypuck PGP key server: Postgres export / Neo4j import
COPY (SELECT substring(uuid for 16) as r_keyid, * FROM openpgp_pubkey)
TO '/tmp/openpgp_pubkey.csv'
WITH (FORMAT CSV, HEADER TRUE, FORCE_QUOTE *, ESCAPE '\');
COPY (SELECT * FROM openpgp_sig
WHERE subkey_uuid IS NULL
AND uid_uuid IS NULL
AND uat_uuid IS NULL
AND sig_uuid IS NULL)
TO '/tmp/openpgp_sig_pubkey.csv'
### Keybase proof
I hereby claim:
* I am georgebrock on github.
* I am georgebrock (https://keybase.io/georgebrock) on keybase.
* I have a public key whose fingerprint is 0750 F6BF 8064 E22C 68D2 3D90 0C64 3A97 B51F FCFB
To claim this, I am signing this object:
@georgebrock
georgebrock / 1.js
Created March 18, 2013 14:09
Stockholm Vim: Vim Golf challenges
// Before
function foo(hello, world,
how, are,
you) {
}
// After
function foo(parameters) {
var hello = parameters.hello;
@georgebrock
georgebrock / gist:5036744
Created February 26, 2013 07:50
Mirroring rubygems
gem install rubygems-mirror
cat <<EOF > ~/.gem/.mirrorrc
---
- from: https://rubygems.org
to: /data/rubygems
parallelism: 10
EOF
until gem mirror; do sleep 1; done
@georgebrock
georgebrock / gist:4715265
Created February 5, 2013 15:45
yampy usage example
import yampy
auth = yampy.Authenticator(client_id="foo", client_secret="bar")
url = auth.authorization_url(redirect_uri="http://myapp.example.com/auth/callback")
# Once the user has authorized the app, and been redirected back:
code = read_the_query_parameters_somehow("code")
access_token = auth.fetch_access_token(code)
yammer = yampy.Yammer(access_token)
@georgebrock
georgebrock / Gemfile
Created October 21, 2012 15:01
Gemfile for Rails issue #7910
source 'https://rubygems.org'
gem 'activeresource', github: 'rails/activeresource', ref: '6639bb4'
gem 'rails', path: '/vagrant/rails'
gem 'journey', github: 'rails/journey', ref: '850267e'
gem 'arel', github: 'rails/arel', ref: 'de7e7c8'
gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders', ref: 'fe150f2'
gem 'sqlite3'
@georgebrock
georgebrock / bisecttest.sh
Created October 17, 2012 08:35
git bisect script for Rails issue 7950
date=`git log -n1 --pretty=format:%ai`
cd ../activerecord-deprecated_finders
git checkout `git rev-list -n1 --before="$date" master`
cd ../rails
unset AR_DEPRECATED_FINDERS
grep active_record_deprecated_finders Gemfile && export AR_DEPRECATED_FINDERS=../activerecord-deprecated_finders
export JOURNEY=../journey
@georgebrock
georgebrock / socks.sh
Created September 29, 2012 20:05
OS X SOCKS proxy script
#!/usr/bin/env bash
# The name of the wireless network has changed between versions of OS X, so we
# need to find the right name:
service=`networksetup -listallnetworkservices | grep -Ei 'wi-fi|airport'`
networksetup -setsocksfirewallproxy $service localhost 9000
networksetup -setsocksfirewallproxystate $service on
echo 'Connecting to proxy.'