Skip to content

Instantly share code, notes, and snippets.

require 'httparty'
require 'nokogiri'
require 'pry'
page = HTTParty.get("http://lafayette.granicus.com/ViewPublisher.php?view_id=3").body
parsed_page = Nokogiri::HTML(page)
all_agenda_link_elements = parsed_page.css("a").select { |link| link.children.text == "Agenda" }
first_agenda = HTTParty.get all_agenda_link_elements[1].attributes["href"].value
binding.pry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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

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

Loading
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 / good_oakland_bars.geojson
Created June 5, 2014 00:47
Using IPython's embed() to interactively play with code at a specific point
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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