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
@tool | |
extends EditorPlugin | |
@export_file(".csv") var csv_path = "res://data/elements/elements.csv" | |
@export_dir var tres_dir = "res://resources/elements/" | |
const converter_path = preload("res://addons/elementimporter/ElementImporter.tscn") | |
var dockedScene |
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 python | |
from time import sleep | |
import requests | |
import pigpio | |
API_KEY = "put you octoprint api key here" | |
GPIO = 18 | |
PI = pigpio.pi() |
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
import importlib | |
import pkgutil | |
def globimport(pattern): | |
base, found, rest = pattern.partition('*') | |
if not (found or rest): | |
try: | |
importlib.import_module(base.rstrip('.')) | |
except ImportError: |
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
def sliding_window(iterable, size, overlap=0): | |
""" | |
>>> list(sliding_window([1, 2, 3, 4], size=2)) | |
[(1, 2), (3, 4)] | |
>>> list(sliding_window([1, 2, 3], size=2, overlap=1)) | |
[(1, 2), (2, 3)] | |
>>> list(sliding_window([1, 2, 3, 4, 5], size=3, overlap=1)) | |
[(1, 2, 3), (3, 4, 5)] | |
>>> list(sliding_window([1, 2, 3, 4], size=3, overlap=1)) | |
[(1, 2, 3), (3, 4)] |
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 python | |
# choose "Select Rows (TSV)" | |
import sys | |
import os | |
table = "" | |
separator = '||' | |
for line in sys.stdin.readlines(): | |
table += "{sep}{c}{sep}\n".format(c=line.replace('\t', separator).strip(), sep=separator) | |
separator = '|' |
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 python | |
import sys | |
# run this: pip install git+https://github.com/lad1337/python-plexapi@feature/download-progress | |
USAGE = "usage: python pcp.py <username> [<password>]" | |
from plexapi.myplex import MyPlexAccount | |
from plexapi.video import Episode | |
from plexapi.video import Movie | |
from plexapi.video import Show |
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 python | |
import sys | |
from graphviz import Digraph | |
dot = Digraph(comment='alembic') | |
def split_line(line): | |
bases, _, name_and_target = line.partition('->') | |
id_and_stuff, _, desc = name_and_target.strip().partition(',') |
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
import cec | |
class PowerStatus(): | |
def __init__(self, power_on): | |
self.power_on = power_on | |
def __str__(self): | |
if self.power_on: | |
return 'on' |
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
from Crypto.Cipher import AES | |
import base64 | |
import re | |
from codecs import open | |
PADDING = '{' | |
BLOCK_SIZE = 32 | |
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING |
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 python | |
# -*- coding: utf-8 -*- | |
try: | |
import requests, clint, easydict | |
except ImportError: | |
import pip | |
pip.main(["install", "requests", "clint", "easydict"]) | |
import requests, clint, easydict | |
import tempfile, re, sys, os, zipfile |
NewerOlder