Skip to content

Instantly share code, notes, and snippets.

View ejona86's full-sized avatar

Eric Anderson ejona86

  • Google
  • Sunnyvale, CA
View GitHub Profile
@ejona86
ejona86 / gist:5afbe84d6c149b16dc823bf97d4964f8
Created February 16, 2024 21:21
Execute Gradle test many times
for (int x = 0; x < 10; x++) {
tasks.test.dependsOn tasks.register('test' + x, Test) {
Task test = tasks.test
useJUnit()
include test.includes
exclude test.excludes
classpath = test.classpath
executable = test.executable
jvmArgs = test.jvmArgs
options.copyFrom test.options
@ejona86
ejona86 / git-gh-fetch
Created August 25, 2022 22:07
git gh-fetch/gh-push utilities to pull and update PR branches
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Usage: $0 REPO_NAME FORK:BRANCH"
exit 1
fi
repo="$1"
user="${2%%:*}"
branch="${2#*:}"
shift 2
exec git fetch "https://github.com/$user/$repo.git" "$branch" "$@"
@ejona86
ejona86 / backport.sh
Last active June 17, 2022 19:25
Custom backport script for grpc-java
#!/bin/bash
# Copyright 2020 The gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software

Keybase proof

I hereby claim:

  • I am ejona86 on github.
  • I am ejona86 (https://keybase.io/ejona86) on keybase.
  • I have a public key ASA08pIl8AkTxo3dgPHS9tLqql6MnwBIxggObME1BLHKPQo

To claim this, I am signing this object:

@ejona86
ejona86 / list-user-installed-packages.sh
Created October 21, 2017 16:35
List user-installed packages on LEDE
#!/bin/sh
FLASH_TIME="$(awk '
$1 == "Installed-Time:" && ($2 < OLDEST || OLDEST=="") {
OLDEST=$2
}
END {
print OLDEST
}
' /usr/lib/opkg/status)"
@ejona86
ejona86 / PersistentBPlus3Tree.java
Created July 17, 2017 16:34
Persistent map data structures
/**
* Persistent (copy-on-write) B+tree of order 3. 2-3 trees are normally
* b-trees, not b+trees. Like all b+trees, values are only stored on the leaves.
*
* <p>B+tree generally has lower insertion cost (in terms of memory allocated)
* than b-tree, even when considering it's increased depth. That is not
* considering b-tree's lower replacement cost for values stored in internal
* nodes.
*/
public class PersistentBPlus3Tree {
@ejona86
ejona86 / escape.go
Created October 11, 2014 06:44
Suboptimal golang escape analysis test
// Package escape allows you to observe suboptimal compiler escape analysis as
// seen in go1.3.3. Try with: `go build -gcflags -m escape.go'
package escape
// Compiler figures out that num does not escape.
func NoEscape() {
for i := 0; i < 2; i++ {
num := new(int)
_ = num
}