Skip to content

Instantly share code, notes, and snippets.

Moving around

  • ⌘⌥ B Jump to definition
  • ⌘ [ Jump back
  • ⌘ ] Jump forward

Running stuff under the cursor

  • ⌥^R Run configurations (e.g. run test)
  • ⌥^D Debug configurations

Comments

@ciaranarcher
ciaranarcher / keybase.md
Created November 4, 2016 14:12
keybase.md

Keybase proof

I hereby claim:

  • I am ciaranarcher on github.
  • I am ciaranarcher (https://keybase.io/ciaranarcher) on keybase.
  • I have a public key whose fingerprint is 2B20 14EF 5BEF 4E4C B84C 5398 D6E7 56FA D997 81B0

To claim this, I am signing this object:

@ciaranarcher
ciaranarcher / gist:6155366af183d92361a9afdd75e24380
Created May 18, 2016 14:22
Dataset comparison shards 303 v 904
# Shard 303
irb(main):003:0> User.count
=> 14932745
irb(main):004:0> PermissionSet.count
=> 7720
irb(main):005:0> Leg.count
=> 167910
irb(main):008:0> Availability.count
=> 6706
16:37 $ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 17 2014 16:27:15)
MacOS X (unix) version
Included patches: 1-488
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
@ciaranarcher
ciaranarcher / goroutines.go
Created September 24, 2014 19:25
Print goroutines
ticker := time.NewTicker(time.Second * 5)
go func() {
for _ = range ticker.C {
fmt.Printf("Goroutine count: %d\n", runtime.NumGoroutine())
}
}()
@ciaranarcher
ciaranarcher / example.go
Created July 27, 2014 06:53
Wrapping a ResponseWriter to capture the status code
// Create our own MyResponseWriter to wrap a standard http.ResponseWriter
// so we can store the status code.
type MyResponseWriter struct {
status int
http.ResponseWriter
}
func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter {
// Default the status code to 200
return &MyResponseWriter{200, res}
@ciaranarcher
ciaranarcher / gist:9098612
Created February 19, 2014 18:41
Error Compiling
$ go get github.com/alecthomas/gozmq
# github.com/alecthomas/gozmq
ld: warning: ignoring file /usr/local/Cellar/zeromq22/2.2.0/lib/libzmq.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/zeromq22/2.2.0/lib/libzmq.dylib
Undefined symbols for architecture i386:
"_zmq_bind", referenced from:
__cgo_7f64089da901_Cfunc_zmq_bind in zmq.cgo2.o
__cgo_7f64089da901_C2func_zmq_bind in zmq.cgo2.o
(maybe you meant: __cgo_7f64089da901_C2func_zmq_bind, __cgo_7f64089da901_Cfunc_zmq_bind )
"_zmq_close", referenced from:
__cgo_7f64089da901_Cfunc_zmq_close in zmq.cgo2.o
@ciaranarcher
ciaranarcher / golang-cheat.md
Last active December 27, 2018 14:26
golang cheatsheet

Types

type Vertex struct {
    Lat, Long float64
}

Maps

package main
import (
"fmt"
"math"
)
func Sqrt(x float64) (z float64) {
z = 1.0
for i := 0; i < 100000000; i++ {
@ciaranarcher
ciaranarcher / sample.clj
Created January 13, 2014 19:58
Concatenate any number of files
(defn cat-many [out files]
(map #(with-open [o (io/output-stream out)]
(io/copy (io/file %) o)) files))
(cat-many "/tmp/ciaran.mp3" '("/tmp/test-recording-1.mp3" "/tmp/test-recording-2.mp3"))