Skip to content

Instantly share code, notes, and snippets.

// The trouble with specialized map types... I need a better name.
package main
import "fmt"
type I interface {
M()
}
type IFunc func()
@bmatsuo
bmatsuo / vmsetup.sh
Last active December 28, 2015 04:59
#!/bin/env bash
# usage: bash <(curl https://gist.github.com/bmatsuo/7446833/raw)
sudo apt-get update
sudo apt-get install ssh git curl vim
git clone git@github.com:bmatsuo/home.git
bash -c 'cd home && bash install.sh'
@bmatsuo
bmatsuo / desired_test.go
Created January 10, 2012 05:58
Golang "testing" file:line prefix
package main
import (
"fmt"
"path/filepath"
"runtime"
"testing"
)
func flushTestConnections() {}
@bmatsuo
bmatsuo / popenrunner.rb
Created September 8, 2011 23:37
Windows capable PopenRunner subclass for the handbrake ruby gem.
require "rubygems"
require "handbrake"
require 'rbconfig'
$on_mswin = Config::CONFIG['target_os'].match(/^mingw/)
require 'win32/open3' if $on_mswin
class MyRunner < HandBrake::CLI::PopenRunner
def command(args)
return super if !$on_mswin
@bmatsuo
bmatsuo / whatcd_singleep_of_the_w.user.js
Created October 10, 2010 02:12
Single/EP of the week that looks like the Featured Album box.
// ==UserScript==
// @name What.cd Single/EP of the Week
// @namespace http://google.com
// @description See the latest Single/EP of the week on the what.cd homepage.
// @include http*://*what.cd/index.php
// ==/UserScript==
//Thanks to dieselpowered for making it more like the Featured Album box!
function getElementsByClassName(classname, node) {
if(!node) node = document.getElementsByTagName("body")[0];