Skip to content

Instantly share code, notes, and snippets.

View bingohuang's full-sized avatar
🎯
Go Coding

Bingo Huang bingohuang

🎯
Go Coding
  • Hangzhou
View GitHub Profile
@bingohuang
bingohuang / golang-set.go
Created December 24, 2018 02:56
Go语言Set集合简单实现
package main
import (
"fmt"
)
type set struct {
m map[string]struct{}
}
@bingohuang
bingohuang / goroutine-1.go
Created December 19, 2016 03:40
Go语言并发编程实例-1
package main
import (
"fmt"
"math/rand"
"sync"
)
func main() {
numberChan1 := make(chan int64, 3) // 数字通道1。
@bingohuang
bingohuang / myip.go
Created August 19, 2016 09:27 — forked from jniltinho/myip.go
Get My IP Golang
package main
/*
URL: https://github.com/mccoyst/myip/blob/master/myip.go
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/
*/
import (
"net"
"os"
@bingohuang
bingohuang / helloworld.go
Created February 20, 2016 06:05
Hello world program written by Go
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello World")
}
@bingohuang
bingohuang / web-server.rb
Last active February 20, 2016 06:07 — forked from Integralist/web-server.rb
Web server written by Ruby.
#!/usr/bin/env ruby
require "webrick"
=begin
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby.
It comes with most installations of Ruby by default (it’s part of the standard library),
so you can usually create a basic web/HTTP server with only several lines of code.
The following code creates a generic WEBrick server on the local machine on port 1234,