This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
go test "$@" | \ | |
sed -E \ | |
-e "/^((--- PASS:.*)|(ok.*)|(PASS.*))$/s//$(printf '\033[32m\\1\033[0m')/" \ | |
-e "/^(\\?.*\\[no test files\\])$/s//$(printf '\033[33m\\1\033[0m')/" \ | |
-e "/^(FAIL.*|--- FAIL:.*)$/s//$(printf '\033[31m\\1\033[0m')/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build !go1.6 | |
package main | |
import ( | |
"regexp" | |
"text/template" | |
) | |
func parseTemplate(tmpl *template.Template, input string) (*template.Template, error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
def gen_lines(readable, chunk_size=8192, sep=b'\n'): | |
buf = io.BytesIO() | |
while 1: | |
buf.seek(0) | |
buffered = buf.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; problem 5 from https://aphyr.com/posts/305-clojure-from-the-ground-up-macros | |
(defmacro exact [expr] | |
`(let [~'+ (fn ([& a#] (apply + (map rationalize a#)))) | |
~'- (fn ([& a#] (apply - (map rationalize a#)))) | |
~'* (fn ([& a#] (apply * (map rationalize a#)))) | |
~'/ (fn ([& a#] (apply / (map rationalize a#))))] | |
~expr)) | |
(let [* (fn ([& a] (apply * (map rationalize a))))] | |
(* 2452.45 100)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[192.168.56.3] run: rm /tmp/streamparse_requirements-EWAsyKnfF.txt | |
Cleaning from prior builds... | |
Creating topology uberjar... | |
Uberjar created: /home/travis/storm-vagrant/topo/_build/wordcount-0.0.1-SNAPSHOT-standalone.jar | |
Deploying "wordcount" topology... | |
ssh tunnel to Nimbus 192.168.56.1:6627 established. | |
Routing Python logging to None. | |
Running lein command to submit topology to nimbus: | |
lein run -m streamparse.commands.submit_topology/-main topologies/wordcount.clj --option 'topology.workers=2' --option 'topology.acker.executors=2' --option 'topology.python.path="/home/storm/virtualenv_root/wordcount/bin/python"' --option 'streamparse.log.max_bytes=1000000' --option 'streamparse.log.backup_count=10' --option 'streamparse.log.level="info"' | |
{:option {streamparse.log.level info, streamparse.log.backup_count 10, streamparse.log.max_bytes 1000000, topology.python.path /home/storm/virtualenv_root/wordcount/bin/python, topology.acker.executors 2, topology.workers 2}, :debug false, :port 6627, :host localhost, :help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/jpeg" | |
"os" | |
"github.com/nfnt/resize" | |
"github.com/oliamb/cutter" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tmp | |
import ( | |
"bufio" | |
"bytes" | |
"mime/multipart" | |
"net/http" | |
"net/http/httptest" | |
"testing" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCzZNqEwnbuMigKFPFjtHAPTWesENDO+HBkc2J84KKUP9n7jZoUYU2bNHJmpBVPYyBZtZbNbkooDkMW2DX4QzYtPlTTEqaQKIvMEdOCODatcdPTA5kbdouKuWZYCe+4PMoSJ+ThatALxYz/npPCEezIdpxAUKAqcvwH5AJn5gbUQPpDPfaz5B/8gdA+PZhOnZiVie2XckoVwj0I+bdU+OE/7Bab2uVJXIbERqU2cNu32Hu6Bd1+NfB0eXxWJNLmQPFLprWdScpns8HZ4xrdPcf6yFt2dV9YibpgCoX3bd9zrSQoUYRKGwvYwd/qNSliIjGOHojwKWZPbD7olFjoXtZ travis@bubbles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_all(fd, data): | |
while data: | |
written = os.write(fd, data) | |
data = data[written:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_all(fd): | |
t = [] | |
while 1: | |
x = os.read(fd, 4096) | |
if not x: | |
return ''.join(t) | |
t.append(x) |