... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| package main | |
| import ( | |
| "myapp/webserver/app/common" | |
| "github.com/golang/glog" | |
| "github.com/gorilla/mux" | |
| "encoding/json" | |
| "strconv" | |
| "flag" | |
| "fmt" |
| package main | |
| import ( | |
| "log" | |
| "fmt" | |
| "encoding/json" | |
| ) | |
| var conf1 = ` | |
| { |
(by @andrestaltz)
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.
| #!/bin/bash | |
| # The script does automatic checking on a Go package and its sub-packages, including: | |
| # 1. gofmt (http://golang.org/cmd/gofmt/) | |
| # 2. goimports (https://github.com/bradfitz/goimports) | |
| # 3. golint (https://github.com/golang/lint) | |
| # 4. go vet (http://golang.org/cmd/vet) | |
| # 5. race detector (http://blog.golang.org/race-detector) | |
| # 6. test coverage (http://blog.golang.org/cover) | |
| set -e |
| <toolSet name="Code Checking"> | |
| <tool name="Flake8" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true"> | |
| <exec> | |
| <option name="COMMAND" value="/usr/local/bin/flake8" /> | |
| <option name="PARAMETERS" value="--max-complexity 10 $FilePath$" /> | |
| <option name="WORKING_DIRECTORY" value="$ProjectFileDir$" /> | |
| </exec> | |
| <filter> | |
| <option name="NAME" value="Filter 1" /> | |
| <option name="DESCRIPTION" /> |
One of my ongoing resolutions is to learn a new programming language every year. I've been looking at Go for a while and I thought it would be fun to use the 'holiday' today to really get cranking. I recorded some random impressions as I was chugging along...
When learning a language, I'm one of those people that can't simply read documentation and contrived code examples with any usable level of recall -- I need to internalize it by writing code to solve a legitimate problem. So, I decided to write a little library, a parser for the Linux /proc filesystem. There aren't very many good ones that I've found for Go (and I am thinking of some projects I may want to use it for in the future).
Steps taken:
| # Add the following 'help' target to your Makefile | |
| # And add help text after each target name starting with '\#\#' | |
| help: ## Show this help. | |
| @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
| # Everything below is an example | |
| target00: ## This message will show up when typing 'make help' | |
| @echo does nothing |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"| require 'rubygems' | |
| require 'keen' | |
| require 'json' | |
| require 'date' | |
| require 'active_support/all' #for datetime calculation e.g. weeks.ago.at_beginning_of_week | |
| require 'simple_xlsx' #for outputting excel files | |
| require 'cgi' #for URL encoding | |
| #================================oOo=================================== |