Skip to content

Instantly share code, notes, and snippets.

View halkeye's full-sized avatar

Gavin Mogan halkeye

View GitHub Profile
import grails.converters.JSON
// Automatically generated. Make future change here.
definition(
name: "gavin_test_pushes",
namespace: "gavin",
author: "Gavin",
description: "Description goes here",
category: "Fun & Social",
@halkeye
halkeye / gist:ac60f9edde682b316449
Created November 19, 2014 08:01
Ugly attempt at mocking out static class
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
namespace UnitTestStatic
{
public class Utilities : IUtilities
{
private static IUtilities _instance = new Utilities();
private Utilities() { }
#!/usr/bin/env ruby
#
# check-supervisor-socket
#
#
# DESCRIPTION:
# Check that all supervisor processes are running using its UNIX domain socket. See unix_http_server section in
# http://supervisord.org/configuration.html.
#
# OUTPUT:
@halkeye
halkeye / main.go
Last active August 29, 2015 14:14
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@halkeye
halkeye / Gemfile
Created February 14, 2015 07:10
Simple set of scripts to create nfo files from a bunch of youtube-dl files
source 'https://rubygems.org'
gem 'youtube_it', '2.4.0'
@halkeye
halkeye / build_uchiwa_tarball.sh
Created March 19, 2015 18:52
Quick script to build a complete uchiwa tarball
#!/bin/bash
export GOPATH=`pwd`
set -e
# grab and compile soruce code
go get github.com/sensu/uchiwa
cd $GOPATH/src/github.com/sensu/uchiwa
export VERSION=$(head -n 1 CHANGELOG.md | sed 's/#\+ \([0-9.]\+\).*/\1/g')
@halkeye
halkeye / nginx.conf
Created March 31, 2015 17:40
nginx+cloudflare redirect
location / {
if ($http_cf_visitor !~ https) {
rewrite ^(.*) https://$http_host$1 permanent;
}
}
(function() {
if (document.getElementsByClassName('show_more_backings')[0].offsetParent !== null) {
alert("You must click 'Show More Pledges' and load all your pledges before running this bookmarklet");
return false;
};
var collectData = function collectData() {
var nodes = $$('#collected .money');
var ksData = [["Project", "Amount", "Currency", "Got It!"]];
for (var i = 0; i < nodes.length; i++) {
var ksRow = [];
@halkeye
halkeye / perl.groovy
Created September 28, 2011 23:13
Perl backend grabber for jenkins
#!/usr/bin/env groovy
// Generates server-side metadata for Perl auto-installation
@GrabResolver(name="m.g.o-public",root='http://maven.glassfish.org/content/group/public/')
@Grab(group='net.sourceforge.htmlunit', module='htmlunit', version='[2.4,)')
import com.gargoylesoftware.htmlunit.html.*;
@Grab(group="org.kohsuke.stapler",module="json-lib",version="2.1",classifier="jdk15")
import net.sf.json.*
import com.gargoylesoftware.htmlunit.WebClient
@halkeye
halkeye / gist:1396870
Created November 27, 2011 03:02
Script to generate project.list per user
#!/bin/sh
# https://gist.github.com/1396870
for i in $( grep gl-auth-command ~/.ssh/authorized_keys | awk '{print $2}' | awk -F'"' '{print $1}' | sort | uniq); do
/home/git/bin/gl-auth-command $i get-perms | sed 's/\r//' | awk '{if ($1 ~ /R/) { print $3 ".git"; }}' > /home/git/projects.list.$i;
done