- 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.
| import sys | |
| import webbrowser | |
| def google_search(query): | |
| base_url = "https://www.google.com/search?q=" | |
| query_string = query.replace(" ", "+") | |
| # show results from the sites below | |
| sites = ["dev.to", "github.com", "medium.com", "stackoverflow.com", "youtube.com"] |
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 | |
| } |