Skip to content

Instantly share code, notes, and snippets.

View siennathesane's full-sized avatar
🫣
monday amirte

Sienna siennathesane

🫣
monday amirte
View GitHub Profile
@siennathesane
siennathesane / criterion.txt
Created November 8, 2023 03:48
Pleiades Initial Performance Tuning
disk engine/disk engine put/1024
time: [3.8519 µs 3.8609 µs 3.8708 µs]
thrpt: [252.29 MiB/s 252.93 MiB/s 253.53 MiB/s]
change:
time: [-7.4819% -6.9997% -6.5191%] (p = 0.00 < 0.05)
thrpt: [+6.9737% +7.5265% +8.0870%]
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe

Keybase proof

I hereby claim:

  • I am mxplusb on github.
  • I am mxplusb (https://keybase.io/mxplusb) on keybase.
  • I have a public key ASDPyrG03R4B3BoSw8JgQh2EKX5lp2m6slenVnrBVJvHNAo

To claim this, I am signing this object:

type ShardRouter struct {
nh runtime.IHost
logger zerolog.Logger
hasher hash.Hash64 // fnv.New64a() since we need fast, not secure
shardCount atomic.Int64
}
// CalcShard is an implementation of Jump Consistent Hash. It computes a string key and returns the shard the key can be
// found in.
// ref: https://arxiv.org/ftp/arxiv/papers/1406/1406.2294.pdf
@siennathesane
siennathesane / sync.cs
Created April 7, 2022 01:04
Example of an incorrectly identified `InconsistentlySynchronizedField` warning in ReSharper
using System;
public class Foo {
private int[] _arr;
private readonly Guid _id;
private readonly object _lockObj;
public this[int index] {
get => _arr[index];
set => Set(index, value);
@siennathesane
siennathesane / gutenberg.py
Last active January 14, 2024 18:11
Download all ePub books from Project Gutenberg. Only dependency is `alive-progress`, can be packaged with PyInstaller.
#!/usr/bin/env python3
from argparse import ArgumentParser
from os import listdir, stat
from os.path import sep as pathsep
from glob import glob
from shutil import SameFileError, copy, get_terminal_size
from typing import Union
from sys import exit, stdout
from alive_progress import alive_bar
from concurrent.futures import ProcessPoolExecutor, as_completed
{"nodes": [{"key": "chapter-08", "attributes": {"node_type": "doc", "color": "#0000FF", "label": "chapter-08"}}, {"key": "hurried nervous manner", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "hurried nervous manner"}}, {"key": "shrill, loud voice", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "shrill, loud voice"}}, {"key": "crimson velvet cushion", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "crimson velvet cushion"}}, {"key": "low voice", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "low voice"}}, {"key": "sulky tone", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "sulky tone"}}, {"key": "unjust things", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "unjust things"}}, {"key": "many footsteps", "attributes": {"node_type": "key_phrase", "color": "#FFA500", "label": "many footsteps"}}, {"key": "little dears", "attributes": {"node_type": "key_phrase", "color
@siennathesane
siennathesane / main.cpp
Created July 27, 2021 18:39
Tmp C++ example file
// ref: https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/samples/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.c
#include <Arduino.h>
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// CAVEAT: This sample is to demonstrate azure IoT client concepts only and is not a guide design principles or style
// Checking of return codes and error values shall be omitted for brevity. Please practice sound engineering practices
// when writing production code.
@siennathesane
siennathesane / start-dev-vm.sh
Created July 22, 2021 18:12
Starts a dev machine on Virtualbox and SSH's into it
#!/bin/bash
set +e
set +x
VM_NAME="$1"
function isInvalid() {
INVALID=$(ipcalc "$1" | grep -c INVALID)
if [ "${INVALID}" -gt 0 ]; then
use timeseriesdb
declare @now datetime2 = sysutcdatetime()
select avg(count) from (select count(*) from (select COLUMN_NAME
from (select *
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = 'default' and TABLE_NAME = 'timeseriestable'
)
where COLUMN_NAME = '%pattern')
resources:
- name: release
type: github-release
source:
owner: 18f
repository: cf-service-connect
access_token: ((github-token))
- name: release-source
type: git
icon: github-circle