Skip to content

Instantly share code, notes, and snippets.

View jphastings's full-sized avatar
🌴

JP Hastings-Spital jphastings

🌴
View GitHub Profile
@hSATAC
hSATAC / gist:5343225
Created April 9, 2013 05:38
Http Redirect in Golang
package main
import (
"log"
"net/http"
)
func redirect(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "http://www.google.com", 301)
@bjhess
bjhess / pull_request_webhook.md
Created May 18, 2012 15:58
The way I had to add a github repo webhook for pull requests

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

{
  "name": "web",
 "active": true,
@bryanveloso
bryanveloso / brew-services.rb
Created December 8, 2011 09:39 — forked from lwe/brew-services.rb
External script for homebrew to simplify starting services via launchctl, out of the box support for any formula which implements #startup_plist. (This version fixes the deprecation warning raised on Formula.resolve_alias.)
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
@jphastings
jphastings / 1.readme.md
Created September 22, 2010 22:41
Got bored, wrote a Yaml parser (ish) in javascript.

Usage

console.log(YAML.eval("Yaml!"))

New features

  • Now does comments (& --- lines)
  • Deals with booleans (yes, no, true, false)
  • Handles multi-line strings (both types!)
  • Single-line hashes now supported
@jphastings
jphastings / Readme.md
Created August 1, 2010 11:15
Scrobble your video watching habits (in Quicktime) to VideoScrobbler.heroku.com

Scrobbalot

Okay! So this is a proof-of-concept video scrobbler. It works with QuickTime and (currently) only mov/mp4/m4v files with metadata. Here's a video of how it works.

It works with my VideoScrobbler website to keep track of what you're watching and when. Even that website is proof-of-concept, please don't expect it to be fit for use, but please do contribute if you're keen!

Changelog

6th Aug 2010