Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd mheadd

View GitHub Profile
@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];
}
<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 / 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.

@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 / 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 / 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 / septa-tweet.js
Created October 27, 2011 16:25
A Node.js script that sends a Growl notification for SEPTA service advisory tweets.
// Include required modules.
var growl = require('growl');
var redis = require('redis');
var http = require('http');
var util = require('util');
// Twitter account name to query.
var twitter_account_name = process.argv[2] || 'SEPTA_WIL';
// Loop interval.
curl -X POST "https://api.smsified.com/v1/smsmessaging/outbound/{sender-address}/requests?address={number-to-send-to}&message=Hi" -u 'username:password'
say('Hello');
var result = ask('Begin entering a series of digits separated by the star key.', {choices: 'http://path-to/grammar.xml', terminator: '#', mode: 'dtmf', timeout: 5.0});
log('*** ' + result.value.replace(" ", "") + ' ***');
say('Hello Voxeo Summit from GitHub.');