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
// remix of https://discordapp.com/channels/605571803288698900/1219282855679496243/1219706356718632981 | |
const std = @import("std"); | |
const Timestamp = struct { | |
seconds: i64, | |
pub fn format( | |
self: @This(), | |
comptime _: []const u8, | |
_: std.fmt.FormatOptions, |
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
// To execute Go code, please declare a func main() in a package "main" | |
package main | |
import ( | |
"log" | |
"reflect" | |
"time" | |
) |
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.io.*; | |
import java.util.*; | |
import static org.junit.Assert.*; | |
// fmt: shift + cmd + f | |
// imports : shift + cmd + o | |
class Solution { | |
// impl | |
// 👇 |
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 |
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 |
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(); |
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())]; |
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
# using rvm with ruby-1.8.7-p249 | |
# latest version 2.7.7 2010-06-17 | |
brew install libxml2 | |
# installing libxslt from source code | |
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz | |
tar xvfz libxslt-1.1.26.tar.gz | |
cd libxslt-1.1.26 | |
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7 |
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 } }}') | |
} |
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 |
NewerOlder