This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[a4paper,landscape]{article} | |
\usepackage[margin=0pt]{geometry} | |
\usepackage{fix-cm} | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} | |
\usepackage[sfdefault]{cabin} | |
\pagestyle{empty} | |
\makeatletter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from PIL import Image | |
from scipy.spatial import ConvexHull | |
import numpy as np | |
img = Image.open('image.png') | |
alphas = list(img.split()[-1].getdata()) | |
region = np.argwhere(alphas) | |
region = [r[0] for r in region] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from PIL import Image | |
from scipy.spatial import ConvexHull | |
import numpy as np | |
img = Image.open('image.png') | |
alphas = list(img.split()[-1].getdata()) | |
region = np.argwhere(alphas) | |
region = [r[0] for r in region] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getElmWithText(selector, elmInnerText){ | |
var elms = document.querySelectorAll(selector); | |
for(var i = 0; i < elms.length; i++) | |
if (elms[i].innerText !== undefined && | |
elms[i].innerText.includes(elmInnerText)) | |
break; | |
return elms[i]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
from pymouse import PyMouse | |
from random import randint | |
from time import sleep | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from urllib.parse import urlparse, parse_qs | |
class MouseMovementCalculator: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
from pymouse import PyMouse | |
from random import randint | |
from time import sleep | |
class MouseMovementCalculator: | |
def __init__(self, gravity, wind, mouseSpeed, targetError): | |
self.gravity = gravity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: | |
// var mouseCalc = new MouseMovementCalculator(7, 5, 20, 200); | |
// var coordsAndDelay = mouseCalc.calcCoordsAndDelay([cursor.x, cursor.y], [destX, destY]); | |
function MouseMovementCalculator(gravity, wind, mouseSpeed, targetError){ | |
this.gravity = gravity; | |
this.wind = wind; | |
this.mouseSpeed = mouseSpeed; | |
this.targetError = targetError; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// selector: string CSS selector, e.g., "#comment-section" or "div.comment, #user-id". | |
// action: function Function to call when an element matches the selector. | |
function waitForElementToExist(selector, action) { | |
var elm = document.querySelector(selector); | |
if(elm !== null) | |
action(elm); | |
else | |
setTimeout(waitForElementToExist.bind(null, selector, action), 100); | |
} |