Skip to content

Instantly share code, notes, and snippets.

(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: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)

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var ArcGIS = require('terraformer-arcgis-parser');
var geojson = ArcGIS.parse({"attributes":{"OBJECTID":1,"UNITNAME":"Admiral William Standley SRA","MgmtStat":"Park Unit or Property"},"geometry":{"rings":[[[-13761597.2359,4814839.6358999982],[-13761525.5836,4814901.4843000025],[-13761000.2678,4814910.8694999963],[-13760905.007300001,4814912.5741999969],[-13760565.695700001,4814918.6353999972],[-13760622.784499999,4814872.6111000031],[-13760668.9476,4814793.0847000033],[-13760674.622099999,4814764.3650000021],[-13760725.478700001,4814669.2823000029],[-13760695.670499999,4814646.4248000011],[-13760706.396400001,4814619.0486999974],[-13760804.101199999,4814662.186999999],[-13760873.4585,4814656.6824999973],[-13760917.006000001,4814585.2906000018],[-13760882.4077,4814508.256099999],[-13760907.517099999,4814462.2704999968],[-13761209.6734,4814565.1185000017],[-13761361.928300001,4814659.2875000015],[-13761409.311099999,4814656.9126999974],[-13761485.3971,4814602.7092999965],[-13761554.1358,4814600.0754999965],[-1
@daguar
daguar / phaxio-multiple-files-with-curl.sh
Last active August 29, 2015 14:00
Phaxio example: sending a fax of multiple files with curl
curl https://api.phaxio.com/v1/send \
-F 'to=4141234567' \
-F 'filename[]=@/path/to/file1.png' \
-F 'filename[]=@/path/to/file2.png' \
-F 'api_key=API_KEY' \
-F 'api_secret=API_SECRET'
#!/usr/bin/env ruby
#
require 'httparty'
require 'json'
require 'pry'
by_categories = Hash.new { |h,k| h[k] = Array.new }
page = 1
total = 0
@daguar
daguar / a-moral-inquiry.md
Last active August 29, 2015 13:58
"A moral inquiry" (George Saunders, excerpt from Tent City USA)

A Moral Inquiry

Retreating down G Street, the PR considered the white girl with red hair. Was she being held against her will? Likely she was a junkie, in some sort of long-term relationship with the tall man, who served as her pimp. Who had she been before she was the white girl with red hair? The PR reminded himself that the white girl with red hair had been a whore in that tent long before he arrived and would be a whore in that tent long after he left. All of these people had been living thus before he arrived and would continue living thus long after he went home. Anything he could do for them would only comprise a small push in a positive direction before the tremendous momentum of their negative tendencies reasserted itself. The PR was put in mind of a single shot from a gun being fired into a massive orbiting planet.

Still, what would happen if he decided to abandon the Study and commit all of his resources to the sole purpose of extracting the white girl with red hair from that tent and getting

<Response>
<Say>What's up dog.</Say>
</Response>
@daguar
daguar / is-it-cash-only.md
Last active August 29, 2015 13:57
An approach for "is it cash only?"

Super-minimal version approach:

  1. On page load, get the location of the user (latitude + longitude) using HTML5 geolocation. This is done using Javascript, as in this example: http://www.w3schools.com/html/html5_geolocation.asp

  2. Show user a simple form with just a text box and button ("Search"). Then, the user enters the name of the restaurant they're looking for into the box and clicks the button.

  3. The form submits the user's text as well as the latitude/longitude from step 1 (as hidden fields in a POST request), this goes to a URL you've coded on the backend.

  4. On the backend, the web app feeds the text and lat/long into a Yelp API search ( http://www.yelp.com/developers/documentation/v2/search_api#searchGC ) and then grabs the first result, and shows it to the user with whether "accepts credit cards" is true or false [see note below.]

@daguar
daguar / ruby-python-js-comparison.md
Last active August 29, 2015 13:56
Comparing the very basics of Ruby, Python, and Javascript syntax with a simple example

Goal

Iterate over an array of numbers and print each value

Python

array = [1,2,3,4]

for number in array: