Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@daguar
daguar / gist:ead5081d3a988c206739
Created September 7, 2014 00:50
Twilio problem: recording starting too late

I'm over at Code for America ( http://codeforamerica.org ) and we've got an app ( https://github.com/codeforamerica/balance/ ) built on Twilio that lets people on food stamps check their EBT card balance via text message.

In ~3 weeks we've got almost 300 successful balance checks so far!

We're trying to expand to states outside California, and I'm bumping up against a tricky issue with some states:

Right now, we're triggering an outbound phone call with sendDigits to navigate the phone tree.

(For example, wait 2 seconds, press 1 to select English, wait 2 seconds, enter the client's EBT card number)

(All the below steps will be in your Nitrous box)

  • Clone the mRelief sample screening app:

git clone https://github.com/mRelief/mrelief_snap_screener_example.git

  • Go into the app directory:
@daguar
daguar / gist:3298859
Created August 8, 2012 21:17
Falling for Ruby: "Holy Crap!" Edition
=begin
Every day I use Ruby I see more and more why people become evangelists.
Take today: I was toying with evaluating different approaches to match two
data sources (API results and a giant local database), and I realized,
"wait! this is a job for yield!"
So I wrote a pleasant little module with a function that:
- Takes a block which attempts to match an API object to rows in the
@daguar
daguar / gist:5640767
Created May 24, 2013 01:43
Zillow neighborhood data exploration in Ruby
require 'pry'
require 'rubillow'
Rubillow.configure do |config|
config.zwsid = ENV["ZILLOW_KEY"]
end
hoods = Rubillow::Neighborhood.region_children({ :state => 'IN', :city => 'South Bend', :childtype => 'neighborhood' })
# Hash method -- not using
#hood_region_ids = Hash.new
@daguar
daguar / gist:6188849
Created August 8, 2013 21:18
My git aliases. Put this in ~/.gitconfig
[alias]
amend = commit --amend -a
br = branch
co = checkout
ds = diff --staged
di = diff
fetchall = fetch -v --all
log-fancy = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative
log-me = !UN=$(git config user.name)&& git log --author="\"$UN\"" --pretty=format:'%h %cd %s' --date=short
log-nice = log --graph --decorate --pretty=oneline --abbrev-commit
@daguar
daguar / gist:7932437
Last active December 31, 2015 04:09
Web mapping notes for CodigoCDMX
@daguar
daguar / gist:8389275
Created January 12, 2014 19:29
D3 OOPy quantizer for 1-5 range
// Quantizing data into buckets
function Quantizer(data_array) {
min = d3.min(data)
max = d3.max(data)
this.quantizeNumber = d3.scale.quantize()
.domain([min,max])
.range([1,5]) // Start with only mapping on 1-5 color scale
}
@daguar
daguar / gist:3aa1ad3d0960f6cb8beb
Created January 26, 2016 01:21
How to set up a Waffle for team and project tasks
so what we do
is have multiple repos, some public some private
you can add private repos to a "meta-waffle” (the repo that sorta holds all others underneath it for waffle’s purposes)
and then it will show up for YOU (and others with permissions) but not for OTHERS
Waffle instructions for managing multiple repos in a single waffle: https://github.com/waffleio/waffle.io/wiki/FAQs#multirepo
so what i’d do is create a new repo (public) called something like “kansas-city-fellows” or somesuch
then that can be the “meta waffle” and you can configure it per the above link by adding additional project-specific repos
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.