Use C-b '
to select a multi-digit window index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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")) |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct vec4_a { | |
union { float x, r; } a; | |
union { float y, g; } b; | |
union { float z, b; } c; | |
union { float w, a; } d; | |
}; | |
union vec4_b { |
Wasavi is some sort of vim implementation for browser text fields.
- Chrome extension: https://chrome.google.com/webstore/detail/wasavi/dgogifpkoilgiofhhhodbodcfgomelhe
- home page: http://appsweets.net/wasavi/
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:
For those who want to go the X server route, let me leave my notes here.
- Install VcXsrv (I found that Xming is outdated on sourceforge and the new version is donationware)
- If it starts after installing, stop it
- Start it using XLaunch (search in the start menu), go with all the defaults (ensure the clipboard options are checked)
- At the end, save the configuration to a file (use that to start it from now on)
- 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. - 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 says0
it does not have clipboard support compiled in. If you don't have clipboard support, install thevim-gtk
package (`apt-get install vi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 { |