Skip to content

Instantly share code, notes, and snippets.

View JonnoFTW's full-sized avatar
⚔️
Fighting off bugs with a sword 🤺

Jonathan Mackenzie JonnoFTW

⚔️
Fighting off bugs with a sword 🤺
View GitHub Profile
@JonnoFTW
JonnoFTW / -
Created December 17, 2015 04:52
10.30.0.159
@JonnoFTW
JonnoFTW / image.py
Created June 17, 2016 12:02
Lane number extraction
import cv2
import numpy as np
def captch_ex(orig_image, iterations, dx, dy, thresh_min):
img = orig_image.copy()
# remove red teal and green colors
img[np.where((img == [255, 255, 127]).all(axis=2))] = np.array([255, 255, 255])
img[np.where((img == [0, 0, 255]).all(axis=2))] = np.array([0, 0, 0])
img[np.where((img == [0, 127, 0]).all(axis=2))] = np.array([0, 0, 0])
img2gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(img2gray, thresh_min, 255, cv2.THRESH_BINARY)
import requests
import shutil
divids = ['101', '102', '103', '104', '105', '106', '107', '108', '109', '111', '112', '113', '114', '115', '117',
'118', '119', '120', '121', '122', '124', '125', '126', '127', '128', '130', '131', '132', '133', '134',
'135', '136', '137', '138', '139', '140', '144', '145', '146', '148', '149', '150', '151', '152', '153',
'155', '156', '157', '158', '159', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169',
'170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '180', '182', '183', '185', '186',
'187', '188', '189', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '200', '201',
'203', '204', '205', '207', '208', '209', '210', '211', '212', '213', '214', '215', '216', '217', '218',
import numpy as np
np.seterr(all='ignore')
results = set()
base_dmg = 117
rapier_dmg = 320
bfs_dmg = 55
dae_dmg = 81
bf_cleave = 0.35
dae_chance = 1 - 0.3
dae_multiplier = 2.2
from PIL import Image
import numpy as np
import pyprind
import random
import os
import pygame
from collections import defaultdict, Counter
class MarkovChain(object):
<pyopencl.Device 'Tonga' on 'AMD Accelerated Parallel Processing' at 0x749460>
Repeating [test_overwrite_ecb()] 1000 times....
Function [test_overwrite_ecb] finished in average of 0:00:00.003962
Repeating [test_overwrite_efb()] 1000 times....
Function [test_overwrite_efb] finished in average of 0:00:00.002380
@JonnoFTW
JonnoFTW / en_au_dict.js
Last active January 21, 2021 19:18
Australian English Dictionary javascript dictionary with no proper nouns
var Dictionary = new Set([
"a",
"aah",
"aardvark",
"aardvarks",
"ab",
"aback",
"abacus",
"abacuses",
"abaft",
/**
* Created by mack0242 on 5/04/17.
*/
var Node = function(value, row, col) {
this.value = value
this.row = row
this.col = col
}
var Path = function() {
@JonnoFTW
JonnoFTW / boggle_solver.js
Last active December 27, 2019 16:01
Javascript boggle solver
/**
* Created by mack0242 on 6/04/17.
*/
var TrieNode = function (parent, value) {
this.parent = parent;
this.children = new Array(26);
this.isWord = false;
if (parent !== undefined) {
parent.children[value.charCodeAt(0) - 97] = this;
}
@JonnoFTW
JonnoFTW / en_au.js
Created April 10, 2017 12:45
english words minus the swears
This file has been truncated, but you can view the full file.
var Dictionary = new Set([
"a",
"aah",
"aardvark",
"aardvarks",
"ab",
"aback",
"abacus",
"abacuses",
"abaft",