Skip to content

Instantly share code, notes, and snippets.

View Shrinks99's full-sized avatar
🌐
Archiving!

Henry Wilkinson Shrinks99

🌐
Archiving!
View GitHub Profile
@Shrinks99
Shrinks99 / focalc.py
Created February 4, 2022 16:13
A simple calculator to determine an image's focal length in pixels based on recorded camera data, lens info, and plate info
imgWidthPx = float(input("Image width in pixels: "))
sensorWidth = float(input("Sensor width in mm: "))
focalLen = float(input("Lens focal length in mm: "))
focalLenPx = str(float(float(focalLen / sensorWidth) * imgWidthPx))
print("The focal length in pixels is: " + focalLenPx)
@kdzwinel
kdzwinel / main.js
Last active May 2, 2024 05:30
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@fredrikaverpil
fredrikaverpil / get_set_values.py
Last active May 20, 2024 20:31
Get and set knob values #nuke
# Get all nodes of type Read
readnodes = nuke.allNodes('Read')
for readnode in readnodes:
print readnode
# List all knobs for selected node
print( nuke.toNode('Read1') )
# List all knobs for specific node
print( nuke.selectedNode() )