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
#!/bin/bash | |
set -euo pipefail | |
table="${1:-}" | |
view="${2:-}" | |
if [[ -z "$table" || -z "$view" ]]; then | |
echo "Usage: $0 <table> <view>" | |
exit 1 |
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
#!/bin/python | |
# vim: ft=python | |
import fileinput | |
import sys | |
pods = open(sys.argv[1], 'r').readlines() | |
cluster_nodes = open(sys.argv[2], 'r').readlines() | |
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
func getStack(skip int) string { | |
buffer := make([]byte, 1024) | |
for { | |
written := runtime.Stack(buffer, false) | |
if written < len(buffer) { | |
// call stack contains of goroutine number and set of calls | |
// goroutine NN [running]: | |
// github.com/user/project.(*Type).MethodFoo() | |
// path/to/src.go:line | |
// github.com/user/project.MethodBar() |
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
#!/bin/bash | |
### | |
### my-script — does one thing well | |
### | |
### Usage: | |
### my-script <input> <output> | |
### | |
### Options: | |
### <input> Input file to read. | |
### <output> Output file to write. Use '-' for stdout. |
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
/* | |
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets. | |
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there). | |
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ . | |
Known limitations: | |
- it won't be able to take into account some external stylesheets (if CORS isn't set up) | |
- it will produce false negatives for classes that are mentioned in the comments. |
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
0 is not stdin on windows | |
#7 started for future. | |
ability to kill sudo background process | |
a bit of refactoring, minor improvements | |
A breath of fresh air | |
accept arbitrary size tokens | |
accept arbitrary types as nested error | |
Account for DataCenter mode while looking for hook scripts | |
Activity reviewing is now avaiable | |
actually, clear status on exit |
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 hookstest | |
import ( | |
"fmt" | |
) | |
func ShouldNotPass() { | |
fmt.Printf( | |
"This code should not pass linting because it has broken message formatting: %s\n", | |
) |
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 hookstest | |
import ( | |
"fmt" | |
) | |
// ShouldPass prints a message that this function passes any code linter | |
func ShouldPass() { | |
fmt.Println("This code should pass any linter") | |
} |
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
var apm = require('elastic-apm-node').start() | |
var http = require('http') | |
var process = require('process') | |
function sleep(time) { | |
var stop = new Date().getTime(); | |
while(new Date().getTime() < stop + time) { | |
; | |
} | |
} |
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
sudo systemctl stop kafka; sudo rm -rf /var/lib/kafka/my-topic-0; sudo systemctl start kafka; AMOUNT=20000 THREADS=5 CYCLES=10 go run main.go | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused | |
2018/07/18 15:02:47 dial tcp [::1]:9092: connect: connection refused |
NewerOlder