Skip to content

Instantly share code, notes, and snippets.

View HunterKohler's full-sized avatar
🇺🇸
Working from the USA

Hunter Kohler HunterKohler

🇺🇸
Working from the USA
  • United States
View GitHub Profile
@HunterKohler
HunterKohler / AW10.bat
Last active May 26, 2020 01:08
Activate all versions of windows 10
@echo off
title Windows 10 ALL version activator&cls&echo ************************************ &echo Supported products:&echo - Windows 10 Home&echo - Windows 10 Professional&echo - Windows 10 Enterprise, Enterprise LTSB&echo - Windows 10 Education&echo.&echo.&echo ************************************ &echo Windows 10 activation...
cscript //nologo c:\windows\system32\slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
@HunterKohler
HunterKohler / autoexec.cfg
Last active June 18, 2020 21:22
Counter-Strike: Global Offensive config files
// LINKED FROM
// "C:\Users\Hunter Kohler\Documents\Gists\CSGO Config\autoexec.cfg"
// LINKED TO
// "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\autoexec.cfg"
// unbinds
unbind "F3"
unbind "F4"
unbind "F5"
export EDITOR=nano
export ZSH=~/.oh-my-zsh
export RC=~/.zshrc
export LIBRARY="/mnt/c/Users/Hunter Kohler"
export PATH="/home/jkohler/.local/bin:/home/jkohler/mongodb/bin:$PATH"
source $ZSH/oh-my-zsh.sh
source ~/powerlevel10k/powerlevel10k.zsh-theme
from typing import Union, Any
class namespace:
def __init__(self, *args: Union[tuple[str, Any], dict[str, Any]], **kwargs):
for arg in args:
if type(arg) == dict:
self.__dict__.update(arg)
elif type(arg) == tuple and len(tuple) == 2:
self.__dict__.update(arg)
else:
@HunterKohler
HunterKohler / running.ascii
Created May 19, 2021 01:58
Guy running down hallway in ascii art. Mildly frightening.
\ /
\ They're behind /
\ you /
] [ ,'|
] [ / |
]___ ___[ ,' |
] ]\ /[ [ |: |
] ] \ / [ [ |: |
] ] ] [ [ [ |: |
] ] ]__ __[ [ [ |: |
@HunterKohler
HunterKohler / env.regex
Last active June 20, 2021 16:40
Environment File Key-Value Pair Regex
^([A-Za-z_][A-Za-z0-9_]*)=(?:([^\s'"#]\S*)|(['"])((?:(?!\3)(?:.|\n)|(?<!\\)(?:\\\\)*\\\3)*)\3|())\s*?(?:#.*)?$
@HunterKohler
HunterKohler / breakable-for-each.js
Created June 30, 2021 02:52
Array with a forEach loop that can be broken out of.
class BreakableArray extends Array {
forEach(callbackFn, thisArg) {
let index = 0;
while(index < this.length) {
let _break = false;
callbackFn.call(thisArg, this[i], index, this, () => _break = true);
if(_break) {
break;
@HunterKohler
HunterKohler / memoize.js
Last active July 4, 2021 11:18
Simple memoizing function and weak value map
const memoize = (() => {
const wvm = new WeakValueMap();
return function (func, hash = JSON.stringify) {
return function () {
const key = hash.apply(this, arguments);
if (wvm.has(key)) {
@HunterKohler
HunterKohler / util.js
Created July 3, 2021 14:36
Callable classes in javascript
export function log(value, options) {
return console.dir(value, {
showHidden: true,
depth: null,
colors: true,
...options
});
}
export function isKey(key) {
@HunterKohler
HunterKohler / cowsay
Last active July 31, 2021 14:39
Very simple cowsay
#!/usr/bin/env bash
set -e
say() {
local -r msg=$(tr -d "\n" <<<"$@")
local -ir len=${#msg}
local hr pad
printf -v hr -- "-%.0s" $(seq $((len > 40 ? 42 : len + 2)))