Skip to content

Instantly share code, notes, and snippets.

View Themis3000's full-sized avatar

Themi Megas Themis3000

  • Minneapolis, MN
View GitHub Profile
import requests
from time import sleep
CHANNEL_ID = "channel id here"
channel_req = requests.get(f"https://archive.vine.co/profiles/_/{CHANNEL_ID}.json")
if channel_req.status_code != 200:
print("failed getting channel data")
quit(-1)
@Themis3000
Themis3000 / generator limit decorator.py
Last active August 16, 2021 00:57
An example of how a decorator can be used to limit the amount of times a generator can be iterated over
class GenLimiter:
"""A decorator used to limit the amount of iterations possible from a generator"""
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
self.limit = kwargs.pop("limit", -1)
self.gen = self.func(*args, **kwargs)
return self
@Themis3000
Themis3000 / afk.js
Created March 31, 2021 05:37
minecraft afk bot
const mineflayer = require('mineflayer')
const autoeat = require("mineflayer-auto-eat")
const pathfinder = require('mineflayer-pathfinder').pathfinder
const Movements = require('mineflayer-pathfinder').Movements
const { GoalNear } = require('mineflayer-pathfinder').goals
//where to afk
const afk_cords = [39794, 201, -39182]
//within how many blocks of afk spot to get
const afk_range = 2
@Themis3000
Themis3000 / spotify_playlist_retriever.py
Last active September 19, 2021 00:07
Retrieves playlists from spotify with no user auth in python
import requests
def get_current_milliseconds():
dt = datetime.now(timezone.utc).replace(tzinfo=timezone.utc)
return dt.timestamp() / 1000
class Spotify:
def __init__(self):
self.access_token = ""
self.access_token_expiration = 0
@Themis3000
Themis3000 / cutter.py
Last active February 15, 2020 03:18
recursively cuts images all images in a file into equal squares according to settings, orginally used to cut out the cards against humanity printable pages into individual images. Great for turning printable cardgame images into individual card images
from PIL import Image
import os
left_margin = 2
top_margin = 2
width = 165
height = 236
right_padding = 4
bottom_patting = 4
@Themis3000
Themis3000 / minedmap_image_conjoiner.py
Last active March 22, 2020 21:35
MinedMap image conjoiner. Merges image files generated by MinedMap into 1 big image file
from PIL import Image
import os
# path to file with map pieces
directory = "C:/Users/.../MinedMap-1.15.1.Win64/MinedMap-1.15.1.Win64/map/map/0"
# [1 - 100] modify this value to change the quality of the output image
quality = 95
# [True/False] downscale image