I hereby claim:
- I am ivan3bx on github.
- I am i3x (https://keybase.io/i3x) on keybase.
- I have a public key ASCJ22U-E5AunADD1zBDe2-VYE_myhHTeVOwiCch37cEAgo
To claim this, I am signing this object:
| package main | |
| import ( | |
| "fmt" | |
| "crypto/md5" | |
| "unicode/utf16" | |
| "strings" | |
| "unicode" | |
| "github.com/pkg/errors" | |
| ) |
| package main | |
| import ( | |
| "net" | |
| "fmt" | |
| ) | |
| // Get the subnet for a given IP address | |
| func geoIP() { | |
| ip := net.ParseIP("128.174.5.59") |
I hereby claim:
To claim this, I am signing this object:
| require 'minitest/autorun' | |
| require 'text' | |
| # An exercise to implement the 'soundex' algorithm | |
| # | |
| # See https://en.wikipedia.org/wiki/Soundex for details | |
| # | |
| # Compare with 'text' gem impl: https://github.com/threedaymonk/text/blob/master/lib/text/soundex.rb | |
| class Soundex | |
| def process(input) |
| #!/usr/bin/env ruby | |
| require 'pathname' | |
| # Upgrade go on linux from binary distribution file | |
| # 1. Will create /usr/local/go-<major>.<minor>.<patch> | |
| # 2. Will create a symbolic link from /usr/local/go -> this version | |
| def run | |
| file = ARGV[0] |
| // runServer will start the HTTPServer, handling graceful | |
| // shutdown on receives SIGTERM / SIGINT, returning nil. | |
| // | |
| // - returns error if the server can not start | |
| // - returns error if the server panics in a way that isn't | |
| // otherwise handled by gin | |
| // - no errors otherwise | |
| func runServer(addr string, r *gin.Engine) error { | |
| s := &http.Server{ | |
| Addr: addr, |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| // queue of size 10 | |
| queue := make(chan string, 10) |
| # | |
| # select unique directories with *.go files | |
| # and appends "/..." ("foo/bar.go" → "./foo/...") | |
| # | |
| find . -type f -name \*go -maxdepth 2 -exec dirname {} \; | uniq | sed 's/\([a-z]\)$/\1\/.../' |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "os" | |
| ) | |
| type Foo struct { | |
| One string |
| // http://eliasbagley.github.io/json/api/alamofire/2015/09/25/making-network-requests-with-alamofire.html | |
| enum APIRouter: URLRequestConvertible | |
| { | |
| static let BASE_URL = "http://foo" | |
| static let API_KEY = "1231254" | |
| case User(Int, closure: () -> [String:AnyObject]) | |
| case Likes(Int, Int) | |
| var URLRequest: NSMutableURLRequest |