Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd mheadd

View GitHub Profile
@mheadd
mheadd / phono-call-test.html
Created November 3, 2011 18:32
A simple Phono example that uses the Phono callme plugin
<html>
<head>
<!-- Uses the Phono callme plugin: http://s.phono.com/releases/0.2/samples/callme/index.htm -->
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/ui-darkness/jquery-ui.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="http://s.phono.com/releases/0.2/jquery.phono.js"></script>
<script type="text/javascript" src="http://s.phono.com/addons/callme/79a53b7/jquery.callme.js"></script>
</head>
<body>
<script type="text/javascript">
@mheadd
mheadd / conference.js
Created November 30, 2011 01:20
Simple Tropo conference script
call(numberToCall, {timeout: 60});
say('Welcome to the conference. Press the pound key to exit.');
conference(conferenceID, {terminator: '#'});
say('Thanks for joining the conference.');
hangup();
@mheadd
mheadd / sample.aspx.cs
Created December 5, 2011 14:33
Sample ASP.NET web page displaying Open311 services in Baltimore
using System;
using System.Web.UI;
using Open311API;
using Open311API.Structs;
namespace WebSample
{
public partial class _Default : Page
{
// The development endpoint for the Baltimore City Open311 API.
@mheadd
mheadd / event-guide.md
Created January 22, 2012 16:21
Code for America Event Guide in Markdown

Code for America Event Guide

Introduction

Code for America relies on the idea that people across the country are willing and eager to get involved and use their skills to make a difference.

Our fellowship program is only one way to make that happen. We want to spark a national movement of civic hackers coming together to build and implement innovative applications that change the way government works. Wherever you are and whatever your background, you can help. You can bring together your friends and other people in your city for meetup or hackathon.

<grammar xml:lang="en-US" version="1.0"
xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd"
tag-format="semantics/1.0">
<rule id="OneDigits" scope="public">
<one-of>
<item>0</item>
<item>1</item>
@mheadd
mheadd / hrtrtf.php
Created February 15, 2012 20:56
Put a JSON facade on top of of Hampton Roads Transit Data
<?php
// FTP URI to transit data.
define("TRANSIT_FTP_URI", "ftp://216.54.15.3/Anrd/hrtrtf.txt");
// Parse a string and return specific element.
function parseString($string, $num) {
$pieces = explode(" ", trim($string));
return $pieces[$num];
}
<?php
if($currentCall->initialText) {
_log("*** User sent: " . $currentCall->initialText . " ***");
$result = ask("", array("choices" => "[ANY]"));
}
else {
call($numberToCall, array("timeout" => 60, "channel" => "TEXT", "network" => "SMS"));
$result = ask("Respond with a digit, any digit.", array("choices" => "[1 DIGIT]"));
}
@mheadd
mheadd / config.js
Created February 23, 2012 14:39
Basic Node.js code sample for querying the Regulations.gov API
exports.credentials = {
api_key : 'YOUR_API_KEY_GOES_HERE'
};
@mheadd
mheadd / cfpb-source-code-policy.txt
Created April 9, 2012 15:44 — forked from CFPBadmin/cfpb-source-code-policy.txt
Consumer Financial Protection Bureau Source Code Policy
1. USE OF EXTERNAL OPEN SOURCE SOFTWARE
a) "Open Source Software" (OSS) is software that allows its recipients to modify and redistribute the source code; as such, "open source" is a copyright and distribution framework and makes no implications regarding technical support or indemnification. In almost all cases, OSS meets the definition of "commercial computer software" and shall be given appropriate statutory preference in accordance with 41 USC 264B (reference (b)) (see also FAR 2.101(b), 12_1.html 12.000, 12.101 (reference (c))).
b) Executive agencies, including CFPB, are required to conduct market research when preparing for the procurement of products or services by 41 USC Sec. 253a (reference (e)) (see also FAR 10.001. Market research for software should include OSS.
a. There are several positive aspects of OSS that should compel CFPB to seek out OSS when conducting market research on software for Bureau-wide use:
i. Publicly available source code enables continuous and broad peer review that
@mheadd
mheadd / list-services.js
Created May 30, 2012 14:10
A simple example using the Node.js module for Open311 in Baltimore.
var util = require('util');
var Open311 = require('open311').Open311;
var options = {
'endpoint': '311test.baltimorecity.gov',
'service_path': '/open311/v2/',
'jurisdiction_id': 'baltimorecity.gov'
};
var report = new Open311(options);