Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Makin'

Jerakin

🔥
Makin'
View GitHub Profile
@Jerakin
Jerakin / p.lua
Created Aug 10, 2020
Quick profiling
View p.lua
local md5 = require "main.md5"
local by_index = {}
local by_id = {}
local function time_it(fnc)
local before = os.clock()
fnc()
print((os.clock() - before)*1000)
end
View combine_tokens.py
from PIL import Image
from pathlib import Path
import json
root = Path(__file__).parent
output = root / "assembled_tokens"
tokens = root / "images"
token_source = root / "token_source"
data_file_folder = root.parent.parent.parent / "assets" / "datafiles"
pokemon_folder = data_file_folder / "pokemon"
@Jerakin
Jerakin / check_package_license.py
Created Jan 2, 2020
a naive way to check for a license file within a python package
View check_package_license.py
import pkg_resources
def get_pkg_license(pkgname):
pkgs = pkg_resources.require(pkgname)
pkg = pkgs[0]
try:
lines = pkg.get_metadata_lines('METADATA')
except:
lines = pkg.get_metadata_lines('PKG-INFO')
@Jerakin
Jerakin / Pokemon5E_Resources.MD
Last active Oct 30, 2019
Resource list for Pokemon5e
View Pokemon5E_Resources.MD

Description: Huge resource for rollable wild pokemon tables if you guys want, its region type specific.
Link: https://docs.google.com/spreadsheets/d/1FkLHvQpa0BKDYcjkB7jcJZmfcQojzchvsE26h3B85V8/edit?usp=sharing
Author: tkdrubberbandman#8426

Description: A collection of realistically drawn Pokemon by arvalis
Link: https://www.deviantart.com/arvalis/gallery/39915677/Realistic-Pokemon
Author: arvalis

Description: Creating your own maps using a tile set.
Link: https://imgur.com/a/7ugTa and https://www.mapeditor.org/

@Jerakin
Jerakin / Emulate_Scrolling_Middle_Button.ahk
Created Oct 9, 2019
Enables you to use any key with cursor movement to emulate a scrolling middle button. Written for Trackball mice.
View Emulate_Scrolling_Middle_Button.ahk
;;
;; Emulate_Scrolling_Middle_Button.ahk
;; Author: Erik Elmore <erik@ironsavior.net>
;; Version: 1.1 (Aug 16, 2005)
;;
;; Enables you to use any key with cursor movement
;; to emulate a scrolling middle button. While
;; the TriggerKey is held down, you may move the
;; mouse cursor up and down to send scroll wheel
;; events. If the cursor does not move by the
@Jerakin
Jerakin / Makefile
Created Sep 23, 2019
Example python Makefile
View Makefile
clean:
rm -rf *.egg-info
rm -rf dist
build:
python setup.py bdist_wheel
install:
pip install ./dist/getbob-$(shell cat "./getbob/__init__.py" | grep -Eo -m 1 "[0-9\.ab]{5,}")-py3-none-any.whl
View gameanalytics.com | Python script for creating CSV files with data grouped by the event category.
#!/usr/bin/python
from __future__ import print_function
import os.path
import csv
import json
import sys
import gzip
import ntpath
_json_loads = None
View collect_images.py
import json
import time
import requests
import shutil
import re
p = r".\pokemon_order.json"
dirty_reg = re.compile("filehistory-selected[^\"]*.*?(cdn\.bulbagarden\.net/upload[^\"]*)")
View resize_atlas.py
# builtin imports
import argparse
from pathlib import Path
from math import ceil
# 3d Party imports
import deftree
from PIL import Image
View CitiesName.py
import random
base = ["Alumel","Pewter","Billon","Muntz","Tumbago","Elinvar","Terne","Nisil", "Sterling"]
sufix = ["ad", "ton", "field", "borough", "pool", "ham", "ford", "ness" "sby", "caster", "stead", "rine", "dra", "wich",
"side", "ster", "wick", "mouth", "gill", "ith", "cliff", "wall", "mere", "city", "town"]
for i in range(100):
a = random.randint(0, len(base)-1)
b = random.randint(0, len(sufix)-1)
You can’t perform that action at this time.