Skip to content

Instantly share code, notes, and snippets.

View ghuntley's full-sized avatar
minimalist

Geoffrey Huntley ghuntley

minimalist
View GitHub Profile
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-I/usr/local/include -DENABLE_MAD -I/usr/local/include -DENABLE_ID3TAG -I/usr/local/Cellar/libao/1.1.0/include -c -o src/main.o src/main.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-I/usr/local/include -DENABLE_MAD -I/usr/local/include -DENABLE_ID3TAG -I/usr/local/Cellar/libao/1.1.0/include -c -o src/player.o src/player.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress \
-I src/libezxml -DENABLE_FAAD \
-I/usr/local/include -DENABLE_MAD -I/usr/local/include -DENABLE_ID3TAG -I/usr/local/Cellar/libao/1.1.0/include -c -o src/settings.o src/settings.c
c99 -O2 -DNDEBUG -I src/libpiano -I src/libwaitress \
@ghuntley
ghuntley / get_itunes_movie_art.py
Created October 5, 2011 05:31 — forked from worksology/get_artwork.py
A quick command line script to get full movie cover art from iTunes. Just run the script using: python get_itunes_movie_art.py and then follow the prompts.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import urllib, urllib2
import json
SEARCH_URL = "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsSearch?entity=movie&term="
SAVE_TO = "%s/Artwork/" % os.environ["HOME"] # Directory must exist
TITLES = [] # Optionally populate this with a list of titles for batch processing
@ghuntley
ghuntley / google-ical-backup.sh
Created October 19, 2011 13:21
google calendar backup
#!/bin/bash
#
# Wget's main Google calendar private ical file
#
# Created by: Graham van der Wielen
# Created on: 20100412
### System Setup ###
CP="$(which cp)"
ECHO="$(which echo)"
@ghuntley
ghuntley / pidCheck.sh
Created October 19, 2011 23:55
function check to see if process is still running (bash)
function pidCheck {
BASENAME=$(basename $0)
PIDFILE=/tmp/$(basename $0).pid
if [ -e $PIDFILE ]; then
PID=`cat $PIDFILE`
if kill -0 &>1 > /dev/null $PID;
then
echo "${BASENAME}: is already running, exiting..."
exit 1
else
@ghuntley
ghuntley / gist:1351749
Created November 9, 2011 15:21
extension methods in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExtensionMethods
{
public static class Extensions
{
#region DateTime
@ghuntley
ghuntley / hack.sh
Created March 31, 2012 10:45 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@ghuntley
ghuntley / fabfile.py
Created April 10, 2012 06:52 — forked from onyxfish/fabfile.py
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
@ghuntley
ghuntley / customer.js
Created April 26, 2012 01:10 — forked from geek0x23/customer.js
A mongoose model that takes advantage of the handy invalidate method to run multiple validations
var mongoose = require('./db-connect'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId,
uuid = require('node-uuid'),
Validator = require('validator').Validator,
val = new Validator(),
bcrypt = require('bcrypt');
Validator.prototype.error = function(msg) { return false; };
@ghuntley
ghuntley / customer.js
Created April 26, 2012 02:06 — forked from geek0x23/customer.js
A mongoose model that takes advantage of the handy invalidate method to run multiple validations
var mongoose = require('./db-connect'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId,
uuid = require('node-uuid'),
Validator = require('validator').Validator,
val = new Validator(),
bcrypt = require('bcrypt');
Validator.prototype.error = function(msg) { return false; };
@ghuntley
ghuntley / client.js
Created April 26, 2012 05:03 — forked from josevalim/client.js
Improve file uploads with Zombie
// Improvements to file uploads with Zombie.
//
// Just start the Sinatra server below and run this file with node.
// Depending on the server used with Sinatra, it will fail upfront or forward
// a bad request to the app. The source code in zombie is in the link below
// (you will need Zombie from git, you can check it out and use `npm link`):
//
// https://github.com/assaf/zombie/blob/master/src/zombie/history.coffee#L93
//
var zombie = require("zombie");