Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd mheadd

View GitHub Profile
@mheadd
mheadd / copilot-cli-comparison.md
Created January 21, 2026 16:52
Copilot CLI Overview

GitHub Copilot CLI Options

There are two different Copilot CLI tools available, and both can be installed and run simultaneously on the same machine.

Comparison

Command What it is Installation
gh copilot A GitHub CLI extension. It integrates with your gh authentication and provides commands like suggest and explain for terminal help. gh extension install github/gh-copilot
copilot A standalone CLI for terminal use. Can be used independently of VS Code for AI-assisted command-line interactions. brew install copilot
@mheadd
mheadd / bdd-specops-compare.md
Last active November 13, 2025 16:02
Comparing similarities and differences between BDD tests and SpecOps specifications

A sample BDD test written in Gherkin

Given applicant income is $15,000
And household size is 3
When eligibility is determined
Then status should be "eligible"
And benefit amount should be $450
@mheadd
mheadd / alphabet.js
Created May 2, 2011 23:31
A collection of code samples used in a talk at JSConf 2011
// A simple JavaScript app that runs on Tropo.
var letters = 'abcdefghijklmnopqrstuvwxyz';
var letterArray = letters.split('');
var start = new Date();
say('Hello, and welcome to Tropo.');
for(var i = 0; i < letterArray.length; i++) {
say(letterArray[i] + '.');
@mheadd
mheadd / SNAP-Locations.csv
Created June 4, 2011 18:44
SNAP Locations in Philadelphia, PA
STORE_NAME longitude latitude ADDRESS CITY STATE ZIP5 zip4
Juliano's Deli Inc. #4 -74.973444952 40.0844016203 4015 Fairdale Rd Philadelphia PA 19154 3609
Juliano's Deli Inc #6 -75.0927498788 40.0522319612 6605 Rising Sun Ave Philadelphia PA 19111 4651
Juliano's Deli Inc. #2 -75.0310460907 40.1038646303 842 RED LION RD Philadelphia PA 19115
Misnik's Deli -75.1047648211 39.9862846768 2530 E Allegheny Ave Philadelphia PA 19134 5111
7 Days Food Market -75.1793963482 39.9934126624 2462 N 29th St Philadelphia PA 19132 3020
Has Has Market -75.1460796752 40.0315925206 5035 N Broad St Philadelphia PA 19141 2232
The New Wilson's Meats, Inc. -75.0977056526 39.9942456054 2325 E Venango St Philadelphia PA 19134 4622
Jo Jo Grocery Store -75.227895648 39.9260610669 2401 S 62nd St Philadelphia PA 19142 3216
Hojin Inc T/a Wiccaco Market -75.1499827328 39.9384947042 776 S 4th St Philadelphia PA 19147 3122
@mheadd
mheadd / dataset-management.md
Last active October 12, 2023 07:53
Sample API calls for creating, updating and deleting things in CKAN via the CKAN API.

Get package list

~$ curl http://www.civicdata.com/api/action/package_list

Get package details

~$ curl http://www.civicdata.com/api/action/package_show?id={package_id}

Upload a file to storage

~$ curl http://www.civicdata.com/api/storage/auth/form/testdata/test.csv -H "Authorization: <API-KEY>"
@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
<?php
// The URL where the test-auth.php script resides.
define("POST_DATA_TO_URL", "http://someurl/my-script.php");
// Function to send value to my-script.php script via cURL with digest authentication.
function submitValue($myValue) {
$ch = curl_init(POST_DATA_TO_URL);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, "admin:mypass");
{
"session": {
"accountId": "9178",
"callId": "4db51dcffa334accbd8012cf1634c146",
"from": {
"channel": "VOICE",
"id": "3026550235",
"name": "unknown",
"network": "SIP"
},
@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;
@mheadd
mheadd / inbound-sms.php
Created May 16, 2011 14:12
A simple PHP script that processes and saves inbound SMS messages from SMSified.
<?php
/*
* Convenience class that parses inbound SMSified JSON into a simple object.
*/
class InboundMessage {
// Class properties.
public $timeStamp;
public $destinationAddress;