Skip to content

Instantly share code, notes, and snippets.

Robbie Vanbrabant robbiev

Block or report user

Report or block robbiev

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
View keybase.md

Keybase proof

I hereby claim:

  • I am robbiev on github.
  • I am robbiev (https://keybase.io/robbiev) on keybase.
  • I have a public key ASDB0xogAyXD74C-obC6GYD-p2Scye0aOKOXUhbG88JQQAo

To claim this, I am signing this object:

@robbiev
robbiev / tmux.md
Created Apr 17, 2017
tmux shortcuts
View tmux.md

Use C-b ' to select a multi-digit window index

@robbiev
robbiev / clipboard.md
Created Apr 14, 2017
clipboard access for WSL / bash on Windows
View clipboard.md

For those who want to go the X server route, let me leave my notes here.

  1. Install VcXsrv (I found that Xming is outdated on sourceforge and the new version is donationware)
  2. If it starts after installing, stop it
  3. Start it using XLaunch (search in the start menu), go with all the defaults (ensure the clipboard options are checked)
  4. At the end, save the configuration to a file (use that to start it from now on)
  5. Put export DISPLAY=localhost:0.0 in your .bashrc in bash for Windows (and run the command in any open bash windows). The reason I explicitly say localhost is that this makes SSH X forwarding work, see below.
  6. Ensure vim is installed using clipboard support. vim --version | grep clipboard should say +clipboard, not -clipboard. Also if you run the ex command :echo has('clipboard') in vim and it says 0 it does not have clipboard support compiled in. If you don't have clipboard support, install the vim-gtk package (`apt-get install vi
@robbiev
robbiev / go-playground-vim.md
Last active Feb 23, 2017
vim keybindings for the Go Playground at https://play.golang.org
View go-playground-vim.md

Wasavi is some sort of vim implementation for browser text fields.

Once installed go to https://play.golang.org, you can use INSERT or CTRL+ENTER to enter the vim mode. To quit use the usual vim commands.

Tips:

  • The default keybinding to enter vim mode, CTRL+ENTER, conflicts with the standard playground shortcuts (CTRL+ENTER to format, SHIFT+ENTER to run). I recommend configuring wasavi to not enter vim mode on CTRL+ENTER (just use INSERT or configure something else)
  • Once you remapped CTRL+ENTER, you can have the following workflow:
@robbiev
robbiev / priority_select.go
Last active Oct 21, 2018
select with priority in go
View priority_select.go
// SOLUTION 1
// see https://groups.google.com/forum/#!topic/golang-nuts/ChPxr_h8kUM
func maybe(b bool, c chan int) chan int {
if !b {
return nil
}
return c
}
select {
@robbiev
robbiev / hello_vertx.clj
Created Sep 8, 2013
Example Vert.x Clojure verticle
View hello_vertx.clj
(ns hello
(:require [vertx.http :as http]))
(-> (http/server)
(http/on-request
#(-> %
(http/server-response)
(http/add-header "Content-Type" "text/html")
(http/end "<html><head/><body></body><h1>Clojure + Vert.x</h1></html>")))
(http/listen 8080 "0.0.0.0"))
You can’t perform that action at this time.