Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd mheadd

View GitHub Profile
@mheadd
mheadd / rtk-most-requested.md
Last active December 17, 2015 23:48
L&I Right to Know Data Requests
  • Commercial Activity Licesne Info - monthy.
  • Building Permit Data.
  • New Construction Data.
  • Vacant Property Data.
  • List of active violations for a particular section of the city.
  • Electrical permits iussued.
  • Plumbing permits.
  • Special assembly licenses info.
  • List of active property maintenance violations for a particular property
@mheadd
mheadd / monitor.sh
Created May 13, 2013 20:00
Simple bash script to check whether MySQL is running.
#!/bin/bash
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
sudo service mysql start
else
echo "All is well.";
fi
@mheadd
mheadd / event.test.js
Created May 11, 2013 17:56
Fun with event emitters.
var EventEmitter = require('events').EventEmitter;
// Create new class.
myCoolObject = function() {};
myCoolObject.prototype = new EventEmitter;
myCoolObject.prototype.doEventEmmission = function(text) {
var self = this;
self.emit('myCoolEvent', 'This is a cool event: ' + text);
};
@mheadd
mheadd / import_school_data.sql
Last active November 11, 2022 11:45
A SQL script for importing School District Data into a MySQL database.
-- ------------------------------------------------------------------------------------
-- A SQL script for importing School District Data into a MySQL database.
-- Download "SDP School Information" ZIP file from the School District Open Data Page
-- http://webgui.phila.k12.pa.us/offices/a/accountability/open-data-initiative.
-- ------------------------------------------------------------------------------------
DROP DATABASE IF EXISTS schooldata;
CREATE DATABASE schooldata;
<?php
say("Hello.");
say("This is tech camp.");
?>
var Config = function() {
// General
this.listen_port = 3000;
// Twilio
this.twilio_sid = "";
this.twilio_token = "";
this.twilio_outgoing = "";
<?php
$rivercast = json_decode(file_get_contents("http://apify.heroku.com/api/rivercast.json"));
say("Hello.");
say("The current river cast on the Skew kill river is," . $rivercast[0]->status . ". Happy recreating.");
say("Goodbye.");
?>
@mheadd
mheadd / hackathon-judging-guidelines.md
Created December 3, 2012 15:15
Technical.ly Civic Hackathon Judging Guidelines

#Yo, you’re judging a hackathon.

Let’s get some order in this place of insanity.

At the end of the hackathon, we’ll have the teams present their projects. To judge winners, we’ll use these standards. We recommend to choose the top three projects based on math across three judges, though these can also remain just guidelines.

###Presentation Does the project, demo or presentation suggest that the project has reached a stage of completion? Is the problem and attempted solution clearly defined? (1 = no; 3 = somewhat; 5 = yes)

###Idea Creativity

@mheadd
mheadd / pipes.js
Created November 20, 2012 20:08
Fun with Node.js Pipes
// Include required modules.
var http = require('http');
// Globally available vars.
var endpoint = 'search.yahoo.com';
var proxyPath = '/search?p=';
// HTTP server for client requests.
var server = http.createServer(function (clientRequest, clientResponse) {
<?php
$grammar = "https://raw.github.com/gist/4055904/a349bed1263e97d30ccb6106598c2cabc5d3916b/th-test.xml";
$station_name = ask("", array("choices" => $grammar, "attempts" => 1));
if($station_name->value == 'NO_MATCH') {
say("I did not understand what you sent.");
}
else {