Skip to content

Instantly share code, notes, and snippets.

Ian Davis iand

Block or report user

Report or block iand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iand
iand / bounds check results
Created Sep 25, 2018
Bounds check elimination in Go
View bounds check results
14:24 $ go build -gcflags="-d=ssa/check_bce/debug=1"
# _/home/iand/wip/bounds
./bounds.go:17:12: Found IsSliceInBounds
./bounds.go:18:10: Found IsInBounds
./bounds.go:19:10: Found IsInBounds
./bounds.go:20:10: Found IsInBounds
./bounds.go:21:10: Found IsInBounds
./bounds.go:23:12: Found IsSliceInBounds
./bounds.go:24:11: Found IsInBounds
./bounds.go:25:11: Found IsInBounds
View keybase.md

Keybase proof

I hereby claim:

  • I am iand on github.
  • I am rauyran (https://keybase.io/rauyran) on keybase.
  • I have a public key ASCihK7Nfrt4-4HkiS7FKTd43EGu6ZO58GfU4bHTpc0U9wo

To claim this, I am signing this object:

@iand
iand / main.go
Last active Dec 7, 2017
How I start writing every command line tool in Go
View main.go
package main
import (
"flag"
"fmt"
"os"
)
func main() {
flag.Parse()
View gist:23af1a408d7eec29117fa260a397f02d
# Show modified files in last commit:
dl = "!git ll -1"
# Show a diff last commit:
dlc = diff --cached HEAD^
# List oneline commits showing relative dates:
ld = log --pretty=format:"%C(yellow)%h\\ %Cred%d\\ %Creset%s\\ %C(green)(%ad)%Cblue\\ [%cn]" --decorate --date=relative
# List oneline commits showing dates
@iand
iand / Benchmark Results
Last active Aug 29, 2015
Benchhmarking Bounds Checking of Slices
View Benchmark Results
BenchmarkBoundsCheckRawLoop 200000 8782 ns/op 0 B/op 0 allocs/op
BenchmarkBoundsCheckRangeIndex 200000 9553 ns/op 0 B/op 0 allocs/op
BenchmarkBoundsCheckRangeVal 200000 8648 ns/op 0 B/op 0 allocs/op
@iand
iand / README.md
Created Jun 26, 2014
Getting started with Cayley
View README.md
View keybase.md

Keybase proof

I hereby claim:

  • I am iand on github.
  • I am rauyran (https://keybase.io/rauyran) on keybase.
  • I have a public key whose fingerprint is BF43 67CC 4922 C201 AC36 465E D360 75B9 93AE D216

To claim this, I am signing this object:

@iand
iand / gist:8581346
Last active Jan 4, 2016
Reasons why Go works for me
View gist:8581346

Some notes on why Go works for me and why it might work for you if you're looking for another language to add to your repetoire. Goes without saying that this reflects my personal taste.

Go features that I particularly like

  • Multicore is the future so I like that Go has concurrency built right into the core. Goroutines and channels provide a very accessible metaphor for thinking about concurrent programming. They're supported by language features that really make Go shine in this area. The select statement, for example, makes it easy to listen to and synchronise events from different concurrent threads.
  • Provides both pointers and value types, but the pointers are safe and managed. Automatic memory management means its safe to return a pointer to a local variable.
  • Interfaces in Go are smooth and unobtrusive. They automatically apply to anything with the right function signature so you can define interfaces that are satisfied by 3rd party code without you having to change it.
  • Errors are signale
View InterruptableTimer.go
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Test interrupt nonsense")
@iand
iand / me.squirtle
Created Jul 10, 2012 — forked from kierdavis/me.squirtle
Squirtle syntax example
View me.squirtle
name <http://kierdavis.com/data/me> as me
name <http://kierdavis.com/data/projects> as projects
pattern ?l ?n ?p ?pt { a foaf:OnlineAccount
rdfs:label ?l
foaf:accountName ?n
foaf:accountServiceHomepage ?p
foaf:isPrimaryTopicOf ?pt
} as Account
me { a foaf:Person
foaf:name "Kier Davis"
You can’t perform that action at this time.