A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
#!/bin/bash | |
cat lista.txt | while read -r file; do wget "$file" && gzip -dc "${file##*/}" | \ | |
tr '[:upper:]' '[:lower:]' | sed \ | |
-e 's/\(_\?noun_\?\)\|\(_\?adp_\?\)\|\(_\?adv_\?\)\|\(_\?det_\?\)\|\(_\?verb_\?\)\|\(_\?adj_\?\)\|\(_\?end_\?\)\|\(_\?conj_\?\)\|\(S\?_\?pron_\?\)\|\(_\?num_\?\)/ /g' \ | |
-e "s/\([^a-zàéèìòù '.]\)/ /g" \ | |
-e "s/\s\{2,\}/ /g" \ | |
-e "s/\.\{2,\}/./g" \ | |
-e "s/[^a-zàéèìòù.]\{1,\}\.\{1,\}//g" \ | |
-e "s/\s\{2,\}/ /g" \ |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-a_.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-aa.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ab.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ac.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ad.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ae.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-af.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ag.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ah.gz | |
https://storage.googleapis.com/books/ngrams/books/googlebooks-ita-all-2gram-20120701-ai.gz |
A running example of the code from:
Small refactorings made to original code:
package main | |
import ( | |
"bufio" | |
"encoding/csv" | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
package main | |
import ( | |
"log" | |
"time" | |
"golang.org/x/net/context" | |
"google.golang.org/grpc" | |
pb "github.com/jzelinskie/grpc/simple" |
APIs: | |
- | |
method: GET | |
url: http://idowhcjymo.apps.wk-0.us-east-1.aws.dev.magalix.cloud:8001/rpush/guestbook/Hello%20World | |
body: ~ | |
PATTERNS: | |
- | |
cron: "0 1 * * * *" # Run every hh:01 (00:01, 01:01, 02:55, ...) | |
concurrent_calls: 10 |
package main | |
import ( | |
"bytes" | |
"encoding/gob" | |
"fmt" | |
) | |
type MyFace interface { | |
A() |
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
package main | |
import "fmt" | |
func main() { | |
user := User{} | |
// Set the group: | |
groupSetter("admin", user) |