Skip to content

Instantly share code, notes, and snippets.

@amb
amb / chainanalysis.py
Created February 13, 2021 21:06
Simple chainanalysis with Python and Blockcypher
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):
@amb
amb / gist:7c6a75202c0b4211a192de90eefe4e81
Created July 6, 2020 16:30
AHK script for better nav in Fusion 360
; 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
@amb
amb / oculus_touch_osc_stream.py
Last active June 10, 2020 23:56 — forked from awesomebytes/htc_vive_controller_keypresses.py
Oculus Touch streaming with pythonosc and openvr
# 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):
@amb
amb / most_used_commands.py
Created August 24, 2019 18:43
Report most used Blender commands for the session and sort them by use count
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()
@amb
amb / gl_compute.py
Created July 29, 2019 20:52
Blender Python OpenGL compute shaders
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])
@amb
amb / prof.py
Created December 30, 2018 14:18
Simple profiling
import cProfile, pstats, io
def profiling_start():
# profiling
pr = cProfile.Profile()
pr.enable()
return pr
def profiling_end(pr):
# end profile, print results