Skip to content

Instantly share code, notes, and snippets.

View colemanm's full-sized avatar

Coleman McCormick colemanm

View GitHub Profile
bundle exec rails c
u = User.last
OR
u = User.where(email: 'coleman@notify.com').last
User::Notifier.delay.welcome(u)
User::Notifier.delay.followup(u)
@colemanm
colemanm / fulcrum_50_words.md
Created April 5, 2013 18:26
Fulcrum 50-word description

Create, deploy, & manage field data collection apps for iPhone, iPad, & Android with the Fulcrum field data collection platform. With our drag-and-drop app designer, create mobile surveys with built-in location, geotagged photos, and full offline support, all to your specifications. Capture exactly what you need in the field.

#!/usr/bin/env ruby
# usage: ruby parse_choices.rb api_key > choices.txt
require 'rubygems'
require 'json'
api_key = ARGV[0]
json = JSON.parse(`curl -H "X-ApiToken: #{api_key}" https://api.fulcrumapp.com/api/v2/choice_lists`)
@colemanm
colemanm / get_proj.sh
Created March 26, 2013 15:17
Print projections for each shapefile in dir
for f in *.shp; do ogrinfo -so -al $f | grep "PROJCS" | sed 's/PROJCS\[\"//g' | sed 's/\",//g'; done
@colemanm
colemanm / cp950.cpg
Created March 25, 2013 15:21
codepage 950
CP950
@colemanm
colemanm / cp936.cpg
Created March 25, 2013 15:20
codepage 936
CP936
https://gist.github.com/5005259
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
# 1. Install PostgreSQL and PostGIS
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@colemanm
colemanm / convert_bsb.sh
Last active December 18, 2023 05:04
Converting NOAA raster charts to GeoTIFF for TileMill
# First convert BSB to GeoTIFF format using the KAP file
gdal_translate -of GTiff 11392_1.KAP 11392_1.tif
# Reproject to WGS84 (geodetic) to use in TileMill
gdalwarp -t_srs EPSG:4326 11392_1.tif 11392_1_wgs.tif
# Then simply add your new `11392_1_wgs.tif` file to TileMill as a new raster layer.
@colemanm
colemanm / fulcrum-visibility-conditions.json
Created June 26, 2012 13:28
Fulcrum visibility conditions
{
"allow_other": false,
"choices": [
{
"label": "Yes",
"value": "Y"
},
{
"label": "No",
"value": "N"