Skip to content

Instantly share code, notes, and snippets.

View iansmith's full-sized avatar

Ian Smith iansmith

  • [stealth-ish]
  • Atlanta GA
  • 08:17 (UTC -04:00)
  • X @iansmith
View GitHub Profile
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@iansmith
iansmith / type_surprise.go
Created October 29, 2011 11:36
suprising for a naive Java or C++ developer
package main
// see https://gist.github.com/1324737 for a java version of the same issue, which does work
type fruit interface {
foo() int
}
type apple interface {
fruit
bar() int
@iansmith
iansmith / type_surprise.java
Created October 29, 2011 16:34
example in java that shows the same case as the go one that does not work (
package example;
// see https://gist.github.com/1324357 for go version
public class TypeSurprise {
public static interface Fooer {
}
@iansmith
iansmith / gozmq-nov9.patch
Created November 13, 2011 14:17
This patch fixes the gozmq package to understand the new error type in go, plus it exports the ZmqErrno type so that one can handle errors more conveniently. It adds the ZMQ_LINGER constant that is available only in ZMQ versions after 2.1, but this appea
From 6d33af21c66901171e84e56c23e3c4d6297f8cb8 Mon Sep 17 00:00:00 2001
From: Ian Smith <iansmith@acm.org>
Date: Fri, 11 Nov 2011 17:57:57 +0100
Subject: [PATCH] appear to have updated this for the current version of go,
weekly on nov 9
---
zmq.go | 97 ++++++++++++++++++++++++++++++++--------------------------
zmq_test.go | 30 ++++++++----------
2 files changed, 67 insertions(+), 60 deletions(-)
package main
import (
"fmt"
"net/http"
"strings"
"seven5/auth"
"seven5/user"
"seven5"
"code.google.com/p/goauth2/oauth"
# i have various enable scripts, ping me if you want to understand the strategy behind these
# this is a translation of the (wonderful) code Kyle W. wrote for zsh. This is the bash version.
# use "source .enable-journal" in a shell where you want to use these functions/aliases
export EDITOR="atom --wait"
alias lsj="ls ~/.journal"
alias cdj="cd ~/.journal"
@iansmith
iansmith / statusapi.md
Last active December 5, 2016 20:13
Explains the purpose of the YikYak status api and how to use it.

Purpose

The purpose of the Yik Yak status API is to allow a third-party application to set the status of a Yik Yak user programmatically. A secondary purpose is to allow a third-party application to set the location of the user (latitude, longitude), even though this is less likely to be less useful to most applications.

Mode Of Use

### Keybase proof
I hereby claim:
* I am iansmith on github.
* I am iansmithga (https://keybase.io/iansmithga) on keybase.
* I have a public key whose fingerprint is 88FF BC62 1308 2EFC E0FA 5E93 2B67 DCEB E647 D69D
To claim this, I am signing this object:
@iansmith
iansmith / frob.go
Created November 8, 2019 17:47
one file for a HTML generation tool from go -- also has some support for bootstrap 4 classes
// +build wasm
//
// The value returned by a tag name function is actually a function (closure) that can be
// instantiated by invoking it with a particular document.
//
// The params to a tag name function can be other tag name functions, Text() to
// set innerHtml, Attribute{attrName:"value"}, Events{eventName:handlerFunc},
// or Clazz (css classes) names. If you pass something else, the tag name
// functions panic.
type Animal interface {
NumberOfLegs() int
}