In this test, inline is 10x faster than arrayt which is 1.4x faster than generator.
This file contains 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
load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | |
load(":rules.bzl", "pkg_executable") | |
# | |
# Package executable :bin to tar | |
# | |
pkg_executable( | |
name = "pkg", | |
bin = ":bin", |
This file contains 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
# A docker credential helper that automatically calls AWS CLI for docker push/pull. | |
cat <<EOF | |
grep -q 'dkr.ecr.[^.]\+.amazonaws.com' - || exit | |
aws --output text ecr get-authorization-token --query authorizationData[0].authorizationToken \ | |
| base64 --decode \ | |
| sed -e 's/:/", "Secret":"/' -e 's/^/{"Username":"/' -e 's/$/"}/' | |
EOF | sudo tee /usr/local/bin/docker-credential-ecr-login | |
sudo chmod +x /usr/local/bin/docker-credential-ecr-login |
This file contains 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 { EventEmitter } from 'events'; | |
import { globalTracer, Span } from 'opentracing'; | |
/** | |
* All events from the emitter share the same span. | |
*/ | |
export function activateEventEmitter(span: Span, emitter: EventEmitter) { | |
const { emit } = emitter; | |
emitter.emit = function(this: any) { | |
const args = arguments; |
This file contains 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 scala.collection.mutable.Map | |
class BiMap[A,B] extends BiMapHelper(Map[A,B](), Map[B,A]()) { | |
} | |
object BiMap { | |
def apply[A,B](elems:(A,B)*) = new BiMap[A,B] ++= elems | |