Skip to content

Instantly share code, notes, and snippets.

@robheittman
robheittman / migrateZone.py
Created December 2, 2014 07:05
Fixed Python zone migration script
import dns.zone
from dns.zone import NoSOA
from dns.exception import DNSException
from dns.rdataclass import *
from dns.rdatatype import *
from dns import rdatatype
import httplib2
import json
import sys
@robheittman
robheittman / gist:e9fdda02e693e4756346
Created May 18, 2014 14:53
Some example gsutil commands to export to Cloud Storage
gsutil cp -R target/* gs://wyoming-budget.solertium.com
gsutil acl -R set public-read gs://wyoming-budget.solertium.com
gsutil setmeta -h "Content-Type:text/html" -h "Cache-Control:public,max-age=60" gs://wyoming-budget.solertium.com/*
### Keybase proof
I hereby claim:
* I am rfc2616 on github.
* I am rfc2616 (https://keybase.io/rfc2616) on keybase.
* I have a public key whose fingerprint is BEF7 9444 9C2D 3B54 4666 C51A A249 2112 F2A0 0300
To claim this, I am signing this object:
@robheittman
robheittman / gist:5172119
Created March 15, 2013 18:50
Broken Ti 3
!ENTRY org.eclipse.ui 4 0 2013-03-15 14:49:54.964
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at com.appcelerator.titanium.mobile.cli.nodejs.NodeIOSInfo.convertToLegacyMap(NodeIOSInfo.java:28)
at com.appcelerator.titanium.mobile.cli.nodejs.NodeIOSInfo.<init>(NodeIOSInfo.java:22)
at com.appcelerator.titanium.mobile.cli.nodejs.IOSNodeJSCommandsHelper.runPackagePrereqCheck(IOSNodeJSCommandsHelper.java:437)
at com.appcelerator.titanium.mobile.cli.nodejs.NodeTitaniumSDKCommandsHandler.runPackagePrereqCheck(NodeTitaniumSDKCommandsHandler.java:398)
at com.appcelerator.titanium.mobile.iphone.IOSConfigurationHelper.runPackagePrereqCheck(IOSConfigurationHelper.java:285)
at com.appcelerator.titanium.mobile.iphone.IOSConfiguration.refreshPrereq(IOSConfiguration.java:202)
@robheittman
robheittman / gist:4001253
Created November 2, 2012 12:59
Redlist startup on my machine
Macintosh-2:iucnredlistwebsite robheittman$ rvm gemset create redlist
'redlist' gemset created (/Users/robheittman/.rvm/gems/ruby-1.9.3-p125@redlist).
Macintosh-2:iucnredlistwebsite robheittman$ rvm gemset use redlist
Using /Users/robheittman/.rvm/gems/ruby-1.9.3-p125 with gemset redlist
Macintosh-2:iucnredlistwebsite robheittman$ gem install bundler
Fetching: bundler-1.2.1.gem (100%)
Successfully installed bundler-1.2.1
1 gem installed
Installing ri documentation for bundler-1.2.1...
Installing RDoc documentation for bundler-1.2.1...
@robheittman
robheittman / gist:2898176
Created June 8, 2012 21:23
Make a Mooyah
killall node; rm -rf olo-mooyah-build && git clone git@github.com:rfc2616/olo-restaurant-apps.git olo-mooyah-build && cd olo-mooyah-build && sh caffeine.sh
@robheittman
robheittman / gist:2763207
Created May 21, 2012 16:44
Static tables for Red List publish
vacuum analyze;
drop table if exists st_countryoccurrencesubfield_countryoccurrencelookup;
create table st_countryoccurrencesubfield_countryoccurrencelookup as select * from vw_published.vw_countryoccurrencesubfield_countryoccurrencelookup ;
drop table if exists st_countryoccurrencesubfield_presence;
create table st_countryoccurrencesubfield_presence as select * from vw_published.vw_countryoccurrencesubfield_presence;
drop table if exists st_countryoccurrencesubfield_origin;
create table st_countryoccurrencesubfield_origin as select * from vw_published.vw_countryoccurrencesubfield_origin;
DROP TABLE IF EXISTS st_countryoccurrence;
CREATE TABLE st_countryoccurrence AS
SELECT country.taxonid, country.assessmentid, country.value, country.recordid, record."CODE" as code, record."DESCRIPTION" as country, pres."LABEL" as presence, origin."LABEL" as origin
@robheittman
robheittman / gist:2719532
Created May 17, 2012 15:08
Looks like a RL CSV export
create table redlist_csv_export (species_id int,kingdom text,phylum text, class text, "order" text, family text, genus text, species text, authority text, infrarank text, infraname text, infraauth text, stock text, synonyms text, common_en text, common_fr text, common_sp text, redlist_status text, redlist_criteria text, redlist_criteria_version text, year text, trend text, petitioned text);
@robheittman
robheittman / mime_types.rb
Created January 13, 2012 02:59
Tell Rack about your static file types, too
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", :xlsx
# For now, the xlsx type is missing from Rack
Rack::Mime::MIME_TYPES.merge!({'.xlsx'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})
@robheittman
robheittman / pg_error_encoding_issue.rb
Created January 1, 2012 18:58
Demonstrate an issue with encoding of error messages
Created database encoding_test_1325444057
Error message encoding is: ASCII-8BIT
#<Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT>
pg_issue.rb:17:in `rescue in <main>'
pg_issue.rb:7:in `<main>'
Dropped database encoding_test_1325444057