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 | |
# Benchmark runner | |
repeats=20 | |
output_file='benchmark_results.csv' | |
command_to_run='echo 1' | |
run_tests() { | |
# -------------------------------------------------------------------------- | |
# Benchmark loop |
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/sh | |
licRes=$( | |
for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do | |
head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo -e " ${file}" | |
done;) | |
if [ -n "${licRes}" ]; then | |
echo -e "license header checking failed:\n${licRes}" | |
exit 255 | |
fi |
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 | |
tmp=$(mktemp) # Create a temporary file | |
trap "rm -f $tmp; exit 1" 0 1 2 3 13 15 | |
header='// Copyright 2016 The Foo Authors | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at |
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" | |
"github.com/coreos/go-systemd/journal" | |
"github.com/coreos/go-systemd/sdjournal" | |
) | |
func main() { |
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 -eu | |
tmpdir=$(mktemp -d) | |
repodir=$(pwd) | |
# first try to extract parts from the remote | |
# e.g. github.com/foo/bar/baz | |
# -> remote = github.com | |
remote=$(git ls-remote --get-url origin|awk -F ':' '{print $1}'|awk -F '@' ' {print $2}') | |
# -> path = foo/bar/baz |