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 cProfile, pstats, io | |
def profiling_start(): | |
# profiling | |
pr = cProfile.Profile() | |
pr.enable() | |
return pr | |
def profiling_end(pr): | |
# end profile, print results |
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 bgl | |
import bpy | |
import numpy as np | |
def install_lib(libname): | |
from subprocess import call | |
pp = bpy.app.binary_path_python | |
call([pp, "-m", "ensurepip", "--user"]) | |
call([pp, "-m", "pip", "install", "--user", libname]) | |
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 bpy | |
import re | |
from collections import defaultdict | |
print("---------------- RERUN ----------------") | |
reports = [bpy.data.texts.remove(t, do_unlink=True) | |
for t in bpy.data.texts | |
if t.name.startswith("Recent Reports")] | |
bpy.ops.ui.reports_to_textblock() |
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
# forked from: https://gist.github.com/awesomebytes/75daab3adb62b331f21ecf3a03b3ab46 | |
import time | |
import openvr | |
from pythonosc import osc_message_builder | |
from pythonosc import osc_bundle_builder | |
from pythonosc import udp_client | |
def get_controller_ids(vrsys=None): |
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
; by twitch.tv/floatharr | |
; rebind fusion360 navigation to be the same as blender emulate mmb | |
#NoEnv | |
#InstallKeybdHook | |
SetKeyDelay, 0 | |
SetMouseDelay, 0 | |
SetControlDelay, 0 | |
SetBatchLines, 0 | |
SendMode input |
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 blockcypher import get_address_details, get_transaction_details | |
import json | |
import datetime | |
def open_chain_info(addr, func): | |
"cache web API data locally" | |
def _datetime_conv(o): | |
if isinstance(o, datetime.datetime): |
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
""" | |
https://bottosson.github.io/posts/oklab/ | |
Lab | |
L=lightness | |
a=green/red | |
b=blue/yellow | |
Lab to lightness, chroma, hue (LCh) | |
C=sqrt(a**2+b**2) |
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
# l.py - A tiny interpreter for a lisp-like language with full | |
# lexical closures in Python | |
# | |
# Written by Ron Garret. Contributed to the public domain | |
# The global environment | |
# modification 2021 ambi, also public domain | |
globalenv = {} |
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 math | |
for i in range(16): | |
print( | |
f"@{(i*16):08x} " | |
+ " ".join(f"{int(-math.cos((j+i*16)*math.pi*2/255)*127.1+128):02x}" for j in range(16)) | |
) | |
# for Xilinx Vivado FPGA purposes | |
# sin_table.mem |
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 mido import MidiFile | |
import mido | |
from collections import defaultdict | |
import time | |
import sys | |
filename = "Space Harrier.mid" | |
# filename = "Shovel.mid" | |
if len(sys.argv) == 2: |
OlderNewer