Skip to content

Instantly share code, notes, and snippets.

View killjoy1221's full-sized avatar

Matthew Messinger killjoy1221

  • NetApp
  • RTP, NC
View GitHub Profile
type Flow<T, O> = Iterable<T> & {
[K in keyof O]: O[K] extends Function ? O[K] : never;
} & {
flow<U>(iterable: (this: Flow<T, O>) => Iterable<U>): Flow<U, O>;
};
type FlowFactory<O> = {
<T>(iterable: Iterable<T>): Flow<T, O>;
};
-----BEGIN CERTIFICATE-----
MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE
AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw
CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ
BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND
VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb
qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY
HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo
G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA
lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr
@killjoy1221
killjoy1221 / lemmy-tweaks.js
Last active November 10, 2023 18:26
User script for lemmy tweaks. Install with violentmonkey or similar browser extension
// ==UserScript==
// @name lemmy style tweaks
// @namespace -
// @match *://*/*
// @grant none
// @version 1.0.1
// @author killjoy1221
// @description Various stylistic tweaks for Lemmy
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// ==/UserScript==
#!/bin/bash
# .pyenv/plugins/install-latest-python/bin/pyenv-install-latest
# Summary: Install the latest version of a python release
#
# Usage: pyenv install-latest [version]
#
# Description:
# This command will pick the latest version as returned from pyenv version --list.
# If an argument is provided, it will be used as a filter.
#
@killjoy1221
killjoy1221 / js-parseint.py
Created March 3, 2022 20:21
Python implementation of parseInt, which converts a value to a string, then reads until the first non-number.
ZERO = ord("0")
NINE = ord("9")
def parseInt(s):
result = None
for i in str(s):
ascii_value = ord(i)
if ZERO <= ascii_value <= NINE:
result = result or 0
import { Puzzle } from './index';
type Predicate<T> = (value: T) => boolean;
interface Passport {
byr: string
iyr: string
eyr: string
hgt: string
hcl: string
@killjoy1221
killjoy1221 / build.gradle
Last active July 2, 2020 23:26
Run config for spongevanilla
plugins {
id 'java-library'
}
repositories {
jcenter()
maven {
name = "SpongeMaven"
url = "https://repo.spongepowered.org/maven"
}
package splooge.api.world;
import kotlin.jvm.internal.PropertyReference1;
import kotlin.reflect.KDeclarationContainer;
import kotlin.jvm.internal.PropertyReference1Impl;
import kotlin.jvm.internal.Reflection;
import org.jetbrains.annotations.NotNull;
import kotlin.reflect.KProperty;
import splooge.api.EnumProvider;
import kotlin.Metadata;
import enum
from typing import Dict, Tuple
import aoc
import bytecode
def main():
instrs = load_instructions()
w = World(instrs)
from typing import List
import aoc
def read_layers(data: List[int], width: int, height: int):
size = width * height
for layer in range(len(data) // size):
yield Layer(data[size * layer:size * (layer + 1)], width, height)