Skip to content

Instantly share code, notes, and snippets.

View mitchhentges's full-sized avatar
🐔
Let's obtain this grain

Mitchell Hentges mitchhentges

🐔
Let's obtain this grain
  • Stockholm, Sweden
View GitHub Profile
[tool.poetry]
name = "poetry-example"
version = "0.1.0"
description = ""
authors = ["Mitchell Hentges"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.6.1"
@mitchhentges
mitchhentges / poetry.lock
Created August 24, 2021 15:07
Poetry transitive dropped requirement
[[package]]
name = "package"
version = "0.0.1"
description = ""
category = "main"
optional = false
python-versions = "*"
develop = false
[package.dependencies]
This file has been truncated, but you can view the full file.
/tmp/python-build.20210616112008.55456 ~/dev
++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:331): http(): local method=get
++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:332): http(): '[' -n https://www.python.org/ftp/python/3.6.12/Python-3.6.12.tar.xz ']'
++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:333): http(): shift 1
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:335): http(): detect_http_client
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:342): detect_http_client(): local client
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:343): detect_http_client(): for client in aria2c curl wget
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:344): detect_http_client(): type aria2c
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:343): detect_http_client(): for client in aria2c curl wget
+++(/home/mitch/.pyenv/plugins/python-build/bin/python-build:344): detect_http_client(): type curl
@mitchhentges
mitchhentges / diff-city.sh
Last active March 24, 2021 15:50
Diff directories to see which files are contributing to file size regressions
#!/bin/bash
set -e
if [[ -z "$1" || -z "$2" ]]; then
echo "usage: ./diff-city.sh new old"
exit 1
fi
old=$1
use cpal::traits::{DeviceTrait, EventLoopTrait, HostTrait};
use sample::{ring_buffer, interpolate, signal, Sample, Signal};
fn main() -> Result<(), failure::Error> {
let host = cpal::default_host();
let event_loop = host.event_loop();
// Default devices.
let input_device = host.default_input_device().expect("failed to get default input device");
let output_device = host.default_output_device().expect("failed to get default output device");
@mitchhentges
mitchhentges / push_apk.py
Last active August 2, 2019 00:11
push_apk(...) with target types
# usage from pushapkscript
def pushapkscript_function_types(publish_config):
apks = ['file', 'file2']
expected_package_names = ['org.mozilla.fenix']
if publish_config['target_platform'] == 'google':
target = GooglePlayPush(
publish_config['google_service_account'],
publish_config['google_credentials_file'],
publish_config['google_track'],
@mitchhentges
mitchhentges / main.py
Created January 7, 2019 21:41
Improving maintenance by reducing the degree of inputs
# Passing dictionaries
def deep_function(context):
expected = context['expected']
actual = context['actual']
return expected == actual
def main():
context = {
'expected': 42,
'actual': 40,

Keybase proof

I hereby claim:

  • I am mitchhentges on github.
  • I am mitch (https://keybase.io/mitch) on keybase.
  • I have a public key whose fingerprint is DA52 BD5B 7FF1 C09B E880 7F90 268A F650 EAC6 06D4

To claim this, I am signing this object:

@mitchhentges
mitchhentges / distributed-lock-timings.c
Last active February 18, 2016 16:49
Calculating timings for a sequential-lock-by-lock algorithm
#include <stdio.h>
#include <stdlib.h>
int compute(int, int);
int main(int argc, char* argv[])
{
printf("\t distributed-lock-timings\n");
printf("Will calculate total time (in units of '1' per 'operation', where 'operation' is requesting a lock, performing transaction, or removing a lock)\n");
printf("These timings are based on two concurrent requests: one trying to change three resources, the other trying to change just one\n");
printf("It is assume that each lock is being acquired sequentially, per request\n");
printf("The requests are running in parallel (other than when blocked by resource contention, of course\n");