Instantly share code, notes, and snippets.

Created December 8, 2016 15:54
View main.go
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
 package main import ( "fmt" "sync" ) func main() { var wg sync.WaitGroup done := make(chan struct{})
Created March 16, 2017 20:14
View main.go
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
 /* https://tour.golang.org/flowcontrol/8 Exercise: Loops and Functions As a simple way to play with functions and loops, implement the square root function using Newton's method. In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z-x)/(2*z) Original formula: https://tour.golang.org/content/img/newton.png
Created December 8, 2016 17:31
View main.go
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
 package main import ( "fmt" "time" ) func main() { inch := make(chan int) outch := make(chan int)
Created November 21, 2016 11:23
View mapgotcha.go
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
 package main import "fmt" type person struct { Name string Age int } func main() {
Created April 6, 2017 06:32
View mirroredQuery.go
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
 package main import ( "fmt" "io/ioutil" "net/http" ) func main() { responses := make(chan string, 3)
Created July 11, 2017 08:02
View keybase.md

### Keybase proof

I hereby claim:

• I am vbauerster on github.
• I am vbauerster (https://keybase.io/vbauerster) on keybase.
• I have a public key ASB3b2WsmEzM0zEf5anFdzxVWDr9H54XJK0hOntQZP7v_go

To claim this, I am signing this object:

Created September 11, 2017 10:36 — forked from diyan/.vimrc
Alexey Diyan's vim configuration file
View .vimrc
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
 " This must be first, because it changes other options as a side effect. set nocompatible " On Windows use '.vim' instead of 'vimfiles' to make sync easier let s:ms_win = (has('win16') || has('win32') || has('win64')) if s:ms_win set runtimepath=\$HOME/.vim,\$VIM/vimfiles,\$VIMRUNTIME,\$VIM/vimfiles/after,\$HOME/.vim/after set shell=/bin/sh endif
Last active April 8, 2018 02:27 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line
View gist:78d48f1c3fa9f430e018

# Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

Created December 11, 2015 10:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md

## The introduction to Reactive Programming you've been missing

(by @andrestaltz)

### This tutorial as a series of videos

If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.

Created April 3, 2014 12:42
View NoRepeatDigit45to4578
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
 /** * * Print From 45 to 4578 Without Repeating Digits * * Write a method that prints all the numbers from 45 to 4578 to the console, * with the constraint that you cannot print any number with repeating digits. * This means the following numbers would be skipped: 11, 22, ...., 122, 110,.... * * Created by vbauer on 19/04/14. */