- Install Docker Desktop
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml file. We recommend you use one of the current tags instead of latest.
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml file. We recommend you use one of the current tags instead of latest.
go build: compiles the packages named by the import paths,
along with their dependencies, the binary does not end up in $GOPATH/bin it gets created in the dirs
go build [-o output] [build flags] [packages]
If the [packages] are a list of .go files, build treats them as a list of source files specifying a single package.
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | 
| /* | |
| go build for linux: | |
| env GOOS=linux go build -o /tmp/server server.go | |
| run with docker: | |
| docker run -it --rm --name test -v /tmp/server:/server -p 3000:80 -p 3001:6060 alpine /server | |
| run pprof debugger: | |
| go get github.com/google/pprof | |
| pprof --seconds 30 -http=:4444 /tmp/server http://localhost:3001/debug/pprof/profile | 
This a collection of interesting links found in The Imposter's Handbook by Rob Conery.
Content:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');Those suck for maintenance and they're ugly.
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 | 
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } | 
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.