Skip to content

Instantly share code, notes, and snippets.

View ewerybody's full-sized avatar
🐍

Eric Werner ewerybody

🐍
View GitHub Profile
@ewerybody
ewerybody / ops.py
Created January 9, 2022 21:13
All the operator __function_names__ with their according operator.
"""
TestCase for directly showing off which __operation__ function name
connects to what runtime operator like `__add__` is called on `+`
more : https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types
"""
class TestClass:
def __add__(self, arg):
import os
import time
import requests
NAME = 'thispersondoesnotexist'
URL = f'https://{NAME}.com/image'
IMG_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), NAME))
# The file name pattern. `nr` will be replaced with the index of the file to write.
IMG_NAME = 'face_{nr}.jpg'
# How many face images you want to download.
@ewerybody
ewerybody / find_emojis_under_186A0.py
Created March 12, 2021 12:08
find emojis under 100000/hex 186A0
#py3 - find emojis under 100000/hex 186A0
import os
MAX_NR = 100000
URL = 'https://unicode.org/Public/emoji/13.1/emoji-test.txt'
TXT_NAME = 'emoji-test.txt'
TXT_PATH = os.path.abspath(os.path.join(__file__, '..', TXT_NAME))
emojis = {}
content = ''
@ewerybody
ewerybody / main.py
Last active January 28, 2021 13:35 — forked from itarozzi/main.py
Frame
# built-in imports should be at the top
# but sys is not even needed! See last block.
# import sys
# Module imports are preferred! Unneeded items should not be imported
from PySide2 import QtCore, QtWidgets
# numbers that are used multiple times or are key to the functionality
# should be in 1 place so one doesn't need to dig for the settings.
SIZE_SMALL = 70
@ewerybody
ewerybody / Unitimedia Wifi Login to password
Last active March 16, 2020 14:21
The password field of my Wifi box is a simple text field! So the browser does not care about remembering what I enter. This turns its type into a password field, the text is hidden now and the browser cares about it. Nice 😀
// ==UserScript==
// @name Unitimedia Wifi Login to password
// @version 1
// @grant none
// @match http://192.168.0.1/common_page/login.html
// ==/UserScript==
var input_field = document.getElementById("loginPassword");
input_field.setAttribute("type", "password");
@ewerybody
ewerybody / telegram_dark_mode.user.js
Last active April 3, 2019 16:10 — forked from digitalheir/telegram_dark_mode.user.js
Tampermonkey / Greasemonkey script for night mode / dark theme in Telegram web (scroll down for instructions)
// ==UserScript==
// @name Telegram dark theme / night mode
// @namespace https://github.com/digitalheir/
// @version 1.0
// @description Dark theme / night mode for Telegram Web
// @author Maarten Trompper <maartentrompper@freedom.nl>
// @match https://web.telegram.org/*
// ==/UserScript==
// Since GM removed it (https://wiki.greasespot.net/GM_addStyle)