Skip to content

Instantly share code, notes, and snippets.

View patricker's full-sized avatar

Peter Wicks patricker

View GitHub Profile
@patricker
patricker / force.py
Created November 25, 2023 18:41
Brute Force Git Commit Hash
import subprocess
import hashlib
import os
import time
from multiprocessing import Pool
import random
import os
def compute_git_hash(content):
header = f'commit {len(content)}\0'.encode('utf-8')
@patricker
patricker / DACDaemonModule.java
Created December 14, 2019 18:47
Dremio Pluggable Helper
protected <IFACE, IMPL extends IFACE> Class<? extends IFACE> setupPluggableService(
final Class<IFACE> bind,
final Class<IMPL> defaultBind,
final SingletonRegistry registry,
final DremioConfig config,
final ScanResult scanResult,
final String configKey) {
//If we want to make it pluggable in the future, but haven't setup a key for it, just use the default implementation
final String keyValue = StringUtils.isEmpty(configKey) ? null : config.getString(configKey);
@patricker
patricker / .block
Created February 22, 2018 03:31
fresh block
license: mit
@patricker
patricker / .block
Last active February 22, 2018 06:26 — forked from mbostock/.block
Zoomable Circle Packing
license: gpl-3.0
height: 960
@patricker
patricker / .block
Created February 21, 2018 07:26
fresh block
license: mit
@patricker
patricker / .block
Last active February 21, 2018 07:51
Pan/Zoom Force Directed Graph
license: mit