View java-modules.txt
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
java.base@11.0.11 | |
exports java.io | |
exports java.lang | |
exports java.lang.annotation | |
exports java.lang.invoke | |
exports java.lang.module | |
exports java.lang.ref | |
exports java.lang.reflect | |
exports java.math | |
exports java.net |
View NonRepeatingStream.java
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 java.util.stream.*; | |
import java.util.concurrent.*; | |
import java.util.*; | |
public <T> Stream<T> nonRepeatingStream(List<T> src) { | |
IntSupplier index = () -> ThreadLocalRandom.current().nextInt(0, src.size()); | |
return Stream.iterate( | |
index.getAsInt(), | |
(prev) -> { | |
int next = index.getAsInt(); |
View non_repeating_rand.rs
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
use rand; // 0.8.3 | |
use rand::Rng; | |
use std::iter::successors; | |
fn non_repeating<T: std::cmp::PartialEq + Clone>(src: &[T]) -> impl Iterator<Item = &T> + '_ { | |
let mut rng = rand::thread_rng(); | |
successors(Some(&src[rng.gen_range(0..src.len())]), move |n| { | |
let mut next = &src[rng.gen_range(0..src.len())]; | |
while *next == **n { | |
next = &src[rng.gen_range(0..src.len())]; |
View human-readable.sh
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
function getHumanReadable() { | |
echo $(echo $1 | awk '{ sum=$1 ; hum[1024**3]="Gb";hum[1024**2]="Mb";hum[1024]="Kb"; for (x=1024**3; x>=1024; x/=1024){ if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x];break } }}') | |
} |
View docker-diff-default.txt
This file has been truncated, but you can view the full file.
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
docker diff 7a3036a55355 | |
C /root | |
A /root/.cargo | |
A /root/.cargo/bin | |
A /root/.cargo/bin/rustfmt | |
A /root/.cargo/bin/rustup | |
A /root/.cargo/bin/cargo-fmt | |
A /root/.cargo/bin/clippy-driver | |
A /root/.cargo/bin/rustc | |
A /root/.cargo/bin/rustdoc |
View report.rs
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
struct Position { line: usize, col: usize } | |
fn report<P>(path: P, content: &str, pos: &Position, error: &str) | |
where | |
P: AsRef<Path>, | |
{ | |
let Position { line, col } = pos; | |
println!( | |
"{}", | |
format!("--> {}:{}:{}", path.as_ref().display(), line, col).dimmed() |
View ecs-exec.sh
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
#!/usr/bin/env bash | |
# runs an arbitrary command on a remote ecs target | |
# | |
# usage: `ecs-exec bash` | |
# | |
# ssh credentials | |
# | |
# Add the following to your ~/.ssh/config file | |
# | |
# Assumes ec2 bastion key for authenicating |
View ecr-cost-usage.sh
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
#!/usr/bin/env bash | |
# discover what values you can use for a given service in the last 3 months | |
# | |
# aws ce get-dimension-values \ | |
# --dimension SERVICE \ | |
# --time-period Start=$(date -v-3m +%Y-%m-01),End=$(date +%Y-%m-01) \ | |
# --query 'DimensionValues[*].Value' | |
# last 3 months of ecr usage/spend |
View rust-binsize.log
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
~/c/r/binsize ❯❯❯ rustc --version | |
rustc 1.31.1 (b6c32da9b 2018-12-18) | |
~/c/r/binsize ❯❯❯ cat src/main.rs | |
fn main() { | |
println!("Hello, world!"); | |
} | |
~/c/r/binsize ❯❯❯ cargo build | |
Finished dev [unoptimized + debuginfo] target(s) in 0.06s | |
~/c/r/binsize ❯❯❯ du target/debug/binsize | |
576K target/debug/binsize |
View ssm-policy.json
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:GetParametersByPath" | |
], | |
"Resource": "arn:aws:ssm:<region>:<account>:parameter/grand-rustacean-central/*" | |
} |
NewerOlder