Skip to content

Instantly share code, notes, and snippets.

View harrisony's full-sized avatar

Harrison Conlin harrisony

View GitHub Profile
@harrisony
harrisony / gist:194140
Created September 26, 2009 10:04
Reports twitter spammers to @spam
# wget http://python-twitter.googlecode.com/svn-history/r151/branches/hameedullah/twitter.py -O twitterwithsearch.py
import twitterwithsearch as twitter
done = []
testfile = open('spammers.txt', 'U')
for p in testfile:
done.append(p.rstrip())
username = ''
password = ''
ts = twitter.Api(username=username, password=password)
aq = ts.Search("CTX Mortgage reportedly for sale",rpp=50)
@harrisony
harrisony / gist:230751
Created November 10, 2009 08:56
TV Timer thing for arduino
/*
* TV Timer by Harrison Conlin
* http://harrisony.com/tvtimer.html
*
*/
#include <LiquidCrystal.h>;
#define BTN2 (15)
#define POT (3)
#define PIEZO (9)
import tweepy
username = 'hugsbot'
password = 'secret'
api = tweepy.API(tweepy.BasicAuthHandler(username,password))
def givehugs():
for follower in tweepy.Cursor(api.followers).items():
print follower.screen_name
api.update_status('@%s Hi, this is your daily hug *hug*' % follower.screen_name)
hugssince = 0
def searchhugs():
Module ImplicitLineContinuations
'After a comma (,).
Public Function test1(ByVal x As Integer,
ByVal y As Object, ByVal z As Object)
Return 1
End Function
'After an open parenthesis (() or before a closing parenthesis ()).
Public Function test2(
ByVal x As Integer, ByVal y As Object, ByVal z As Object
)
@harrisony
harrisony / gist:3877260
Created October 12, 2012 04:15
Awesome hacky code!
void list_generator(int (*process)(Record, string[]), string options[], string success, string failure){
bool _recordcount = 0;
Record processing[recordcount];
for (int i=0; i <= recordcount; i++){
if ((*process)(records[i], options) > 0){
processing[++_recordcount] = records[i];
}
}
if (_recordcount > 0){
cout << success;
@harrisony
harrisony / TimezonePatch.diff
Last active December 11, 2015 03:09
make simplesamlphp less strict in timezone parsing
--- Utilities.php.orig 2013-01-17 13:50:22.892638237 +1100
+++ Utilities.php 2013-01-17 13:49:42.712169200 +1100
@@ -355,7 +355,7 @@
/* We use a very strict regex to parse the timestamp. */
if(preg_match('/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)' .
- 'T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?$/D',
+ 'T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?(Z)?$/D',
$time, $matches) == 0) {
throw new Exception(
@harrisony
harrisony / vcs-update.sh
Created March 31, 2013 08:44
A quickly hacked up script to update folders from VCS
#!/bin/sh
find $1 -mindepth 1 -maxdepth 1 -type d | while read -r dir
do
pushd "$dir"
echo $dir
if [[ -d ".git" ]]; then
git pull
fi
if [[ -d ".hg" ]]; then
hg pull
@harrisony
harrisony / downforeveryoneorjustme.sh
Created April 7, 2013 01:26
quick down for everyone or just me check
#!/bin/sh
wget -q -O - "http://downforeveryoneorjustme.com/$1" | grep -E '.*class="domain"' | sed 's/<a href.*>\(.*\)<\/a>/\1/' | sed 's/<\/span>//'
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
#!/usr/bin/env python
# ReadingListCatcher
# - A script for exporting Safari Reading List items to Markdown and Pinboard
# Brett Terpstra 2015
# Uses code from <https://gist.github.com/robmathers/5995026>
# Requires Python pinboard lib for Pinboard.in import:
# `easy_install pinboard` or `pip install pinboard`
import plistlib
from shutil import copy
import subprocess