Skip to content

Instantly share code, notes, and snippets.


Brice Dutheil bric3

Block or report user

Report or block bric3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#!/usr/local/bin/java --source 11 --add-opens java.base/sun.nio.fs=ALL-UNNAMED
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFileAttributes;
public class FileBirth {
public static void main(String[] args) throws Throwable {
bric3 /
Created Mar 13, 2019 — forked from norswap/
Fast Java Reflection
package demo;
public interface Node {}
bric3 / checknetwork.gradle
Last active Jan 7, 2019
Makes gradle go automatically go offline
View checknetwork.gradle
* Makes gradle go automatically offline.
* Store in $HOME/.gradle/init.d/checknetwork.gradle
apply plugin : CheckNetwork
class CheckNetwork implements Plugin<Gradle> {
void apply(Gradle gradle) {
bric3 /
Last active Jun 29, 2018 — forked from minniel/
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
import requests
import urllib3
#from io import open
from datetime import datetime
bric3 /
Created Oct 1, 2016 — forked from raphw/
A Java agent for fixing exports for an app that is not yet Java 9 aware.
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Layer;
import java.lang.reflect.Module;
import java.util.*;
public class WeakeningAgent {
public static void premain(String argument, Instrumentation instrumentation) {
boolean full = argument != null && argument.equals("full");
Set<Module> importing = new HashSet<>(), exporting = new HashSet<>();
bric3 /
Created Sep 7, 2016
Trying different ways to accurately sleep in java
public class Sleeper {
private static final long SLEEP_PRECISION = TimeUnit.MILLISECONDS.toNanos(2);
private static final long SPIN_YIELD_PRECISION = TimeUnit.MILLISECONDS.toNanos(2);
public static void main(String... args) throws InterruptedException {
final BlockingQueue SLEEPER = new ArrayBlockingQueue(1);
System.out.println("Blocking Queue");
for (int i = 0; i < 100; i++) {
long start = System.nanoTime();
package bob.yop;
import static;
import static net.bytebuddy.matcher.ElementMatchers.nameContains;
import static net.bytebuddy.matcher.ElementMatchers.named;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import net.bytebuddy.agent.ByteBuddyAgent;
import net.bytebuddy.agent.builder.AgentBuilder;
bric3 /
Created Mar 24, 2016 — forked from miguno/
A simple Ops helper script for Apache Kafka to generate a partition reassignment JSON snippet for moving partition leadership away from a given Kafka broker. Use cases include 1) safely restarting a broker while minimizing risk of data loss, 2) replacing a broker, 3) preparing a broker for maintenance.
#!/usr/bin/env bash
# File:
# Description
# ===========
# Generates a Kafka partition reassignment JSON snippet to STDOUT to move the leadership
# of any replicas away from the provided "source" broker to different, randomly selected
# "target" brokers. Run this script with `-h` to show detailed usage instructions.
View benchmark-commands.txt
bin/ --zookeeper --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/ --zookeeper --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/ test7 50000000 100 -1 acks=1 buffer.memory=67108864 batch.size=8196
bric3 /
Last active Oct 3, 2019
Shell (commands) tips accumulated over years



Create table using with

with user_count as (
You can’t perform that action at this time.