Skip to content

Instantly share code, notes, and snippets.

View mdb's full-sized avatar

Mike Ball mdb

View GitHub Profile
@mdb
mdb / gist:1037772
Created June 21, 2011 12:39 — forked from gsf/gist:1036573
phlapi
// possible ideal for handling sanitation districts
var address = $('#addressInput').val();
phl(address, 'http://some.api.url' function(districts) {
$.each(districts, function(index, value) {
$('ul').append('<li>'+value+'</li>');
});
});
@mdb
mdb / Google Calendar Atom Reader
Created April 10, 2011 20:51
Grabs And Displays a Public Google Calendar's Atom Feed
<?php
//Used to fetch Google Calendar Atom feed
function getShortCalFeed($feed_url) {
$feed_content = file_get_contents($feed_url);
$feed = new SimpleXMLElement($feed_content);
$namespaces = $feed->getNamespaces(true);
//set max entries to loop through and a count var
$maxLoop = 4;
@mdb
mdb / gist:820540
Created February 10, 2011 13:57
fc_make_local_frags.sh
#!/bin/bash
# This script:
# 1) makes a directory at $new_directory_loc.
# By default, wordpress/wp-content/ctv/local.
# 2) copies files from $files_to_copy $new_directory_loc.
# By default, from wordpress/wp-content/ctv/* to wordpress/wp-content/ctv/local/
# 3) replaces all instances of $find_css with $replace_css in the files copied to
# $new_directory. By default, the relative css paths are replaced with complete
# css paths pointing to our local dev server.
#!/bin/bash
# Running this script via ./smartcommit.sh provides a fast way
# to selectively include files in an 'svn commit.'
# The script can be used as follows:
#
# 1. Enter ./smartcommit.sh at the command line from within the project's directory
# 1. A temporary file containing an 'svn status' list is opened in Vim
# 2. Remove any lines specifiying files you DO NOT want to commit
# 3. Enter :wq in command mode to save and quit the temporary file