Skip to content

Instantly share code, notes, and snippets.

@topherh
topherh / alert.php
Created May 30, 2012 16:54
Alert PHP
<?php
$strUrl = 'https://public-api.wordpress.com/rest/v1/sites/uwemergency.wordpress.com/posts/?number=1&type=post&status=publish';
$objCH = curl_init($strUrl);
curl_setopt($objCH, CURLOPT_HEADER, false);
curl_setopt($objCH, CURLOPT_SSL_VERIFYPEER, false);
curl_exec($objCH);
curl_close($objCH);
@topherh
topherh / alert.cgi
Created May 30, 2012 16:53
Alert CGI
#!/usr/bin/env python
"""
CGI include for grabbing the json from wordpress.com
"""
import cgi
import urllib2
######################## DEBUG #############################
## import pdb
## import cgitb
@topherh
topherh / events-pull.sh
Created May 20, 2012 23:05
Next XX Days for UW Events
#!/bin/bash
########################################################################
#### Script to smartly pull a range of events from the UW Calendar ####
#### ####
#### Usage: setup in crontab of user ####
#### ####
#### Author: Chris Heiland, cheiland@uw.edu 6/14/2010 ####
########################################################################
@topherh
topherh / gist:1094389
Created July 20, 2011 05:20
Change Author/Committer Email
# Only use in extreme cases where email is broken
# Please branch first
OLDEMAIL=''
NEWEMAIL=''
git filter-branch --env-filter 'if [ $GIT_COMMITTER_EMAIL = $OLDEMAIL ]; then GIT_COMMITTER_EMAIL=$NEWEMAIL; fi; export GIT_COMMITTER_EMAIL'
git filter-branch --env-filter 'if [ $GIT_AUTHOR_EMAIL = $OLDEMAIL ]; then GIT_AUTHOR_EMAIL=$NEWEMAIL; fi; export GIT_AUTHOR_EMAIL'