Skip to content

Instantly share code, notes, and snippets.

View gwillen's full-sized avatar

Glenn Willen gwillen

  • SF Bay Area, California
View GitHub Profile
You are CodeGPT, a smart and reliable AI programming helper. Since it's expensive and slow to transmit your words to the user, you try to be concise:
- You don't repeat things you just said in a recent message.
- You only include necessary context in code snippets, and omit or abbreviate unnecessary lines.
- You don't waste space with unnecessary apologies or hedging.
- When you have a choice, you use short class / function / parameter / variable names, including abbreviations where appropriate.
- If a question has a direct answer, you give that first, without extra explanation; you only explain if asked.
@gwillen
gwillen / find_games.js
Last active September 24, 2016 23:26
Userscript to find OGS games
// ==UserScript==
// @name Find good Go games
// @namespace http://nerdnet.org/
// @version 0.1
// @description find good Go games on online-go.com
// @author Glenn Willen (gwillen@nerdnet.org)
// @match *://online-go.com/*
// @grant none
// ==/UserScript==
@gwillen
gwillen / rusti_state.rs
Last active November 2, 2015 19:09
Horrible hack to enable mutable state in rusti
use std::collections::HashMap;
std::env::set_var("RUSTI_HACK_SYMTAB",
format!("{:?}",
Box::into_raw(Box::new(HashMap::<&str, i64>::new()))));
fn hack_symtab() -> &'static mut HashMap<&'static str, i64> {
unsafe {
std::mem::transmute(
i64::from_str_radix(
&std::env::var("RUSTI_HACK_SYMTAB").unwrap()[2..],

Keybase proof

I hereby claim:

  • I am gwillen on github.
  • I am gwillen (https://keybase.io/gwillen) on keybase.
  • I have a public key whose fingerprint is F95E 06E4 5B89 7FB2 44FF FE01 73C6 385F 7D28 0EB4

To claim this, I am signing this object:

-- This work is licensed under a CC BY-NC-SA 3.0 license.
-- http://creativecommons.org/licenses/by-nc-sa/3.0/
--
-- by Spike Padley
--
-- Usage: branchMine <length>
-- Fuel goes in slot 1. Torches go in slot 2. Floor blocks (usually cobblestone) go in slot 3.
-- Mines a trunk <length> blocks long, with an 8 block long branch, on each side, every 3 blocks, starting 2 blocks in (n=3n-1)
local blocksMovedForward = 0
Install and configure brew
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ touch ~/.bashrc
$ echo "export PATH=\`brew --prefix\`/bin:\`brew --prefix\`/share/python:\$PATH" >> ~/.bashrc
$ echo "export CFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ echo "export ARCHFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ source ~/.bashrc
$ brew doctor
Do what the doctor says! This will more than likely include installing XCode from the App Store and then installing the "Command line tools" from "Xcode > Preferences > Downloads"