Skip to content

Instantly share code, notes, and snippets.

View kamronbatman's full-sized avatar

Kamron Batman kamronbatman

View GitHub Profile
@kamronbatman
kamronbatman / otpauth-migration.md
Last active December 26, 2022 23:03
Open Google Authenticator otpauth-migration URLs in Windows with otpauth

Exporting Google Authenticator

Install otpauth

  1. Download otpauth
  2. Extract all files to C:\otpauth. If you want a different location, modify the reg file path.
  3. Import otpauth-migration.reg

Extract OTPs

  1. Start the Google Authenticator > Transfer Accounts > Export Accounts process
  2. Take pictures of the QR codes using the Windows Camera App in document mode.
@kamronbatman
kamronbatman / GreatestCommonDivisor.cs
Created May 15, 2022 20:47
Greatest Common Divisor in C# .NET 6
// Greatest Common Divisor in .NET 6
public static class Utility
{
public static uint GreatestCommonDivisor(uint u, uint v)
{
if (u == 0)
{
return v;
}
@kamronbatman
kamronbatman / PCDWC4.js
Created May 1, 2022 17:28
Pokemon Gen 4 PCD -> WC in JS
const fs = require('fs');
const path = require('path');
function mu32(a, b) {
var ah = (a >> 16) & 0xffff, al = a & 0xffff;
var bh = (b >> 16) & 0xffff, bl = b & 0xffff;
var high = ((ah * bl) + (al * bh)) & 0xffff;
return (((high << 16)>>>0) + (al * bl)) & 0xffffffff;
}
@kamronbatman
kamronbatman / MUO_CLA
Last active August 14, 2023 23:42
ModernUO CLA
### ModernUO Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by ModernUO or its affiliates (“ModernUO”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to ModernUO in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact opensource@ModernUO.com.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to ModernUO a non-exclusive, perp
@kamronbatman
kamronbatman / cryptFile.js
Last active January 29, 2019 07:31
Compresses and encrypts text files for exchanging credentials, private keys, and environment variables using Node.
#!/usr/bin/env node
const { promisify } = require('util');
/* eslint-disable import/no-extraneous-dependencies */
const glob = promisify(require('glob'));
/* eslint-enable */
const cryptFile = require('../util/cryptFile');
const handler = async (command, secret, ...filePathArgs) => {
@kamronbatman
kamronbatman / countries_states.json
Last active June 21, 2018 19:07 — forked from e1024kb/gist:41bf38fdb1a2cb19a781
Country/State List in JSON
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@kamronbatman
kamronbatman / uuidv4.js
Created April 27, 2018 01:53
Modern UUIDv4 for Browsers using ES6
const hex = bytes => bytes.reduce((total, byte) => (
total + byte.toString(16).padStart(2, '0')
), '');
const genUUID = () => {
const bytes = new Uint8Array(16);
window.crypto.getRandomValues(bytes);
bytes[6] = (bytes[6] & 0x0f) | 0x40;
bytes[8] = (bytes[8] & 0x3f) | 0x80;
class NewItemThing : Item, INotifyPropertyChanged, IQueuePersistable
{
public static event EventHandler<PropertyChangedEventArgs<String>> StringPropertyChanged;
private static void StringPropertyChanged(object obj, string propertyName, string value)
{
if (StringPropertyChanged != null)
{
StringPropertyChanged(obj, new PropertyChangedEventArgs_String(propertyName, value));
}
@kamronbatman
kamronbatman / pokemon_generation_unused.asm
Last active April 23, 2017 04:20
Unused Pokemon Generation - PCJP 2003
; =============== S U B R O U T I N E =======================================
pokemon_generation_unused
var_34 = -0x34
var_30 = -0x30
var_2C = -0x2C
var_28 = -0x28
var_24 = -0x24
@kamronbatman
kamronbatman / sample0519_sub_6974.asm
Created April 19, 2017 06:12
Sample0519 Generation
sub_6974 ; CODE XREF: ROM:00006B94p
var_2C = -0x2C
var_28 = -0x28
var_24 = -0x24
var_20 = -0x20
var_1C = -0x1C
PUSH {R4-R7,LR}
MOV R7, R8