Skip to content

Instantly share code, notes, and snippets.

@keturn
keturn / jupyter_oiio.py
Created March 27, 2025 05:19
openimageio helpers for jupyter notebook
import os
import tempfile
from contextlib import contextmanager
from dataclasses import dataclass
import OpenImageIO as oiio
import einops
DTYPE_TO_OIIO = {
@JeanChristopheMorinPerso
JeanChristopheMorinPerso / README.md
Last active March 13, 2025 21:41
Debugging missing symbol error when importing a python extension on Windows

I stumbled on a case where a user of https://pypi.org/project/OpenImageIO/'s wheels on Windows was reporting that they could not import the library in Nuke 14.1.

To debug the issue, I created an EC2 instance with a GPU using the NVidia WinServer 2022 AMI, installed Nuke and tried to import OpenImageIO. I was able to reproduce immediately.

Let's install OpenImageIO using Nuke's python interpreter:

& 'C:/Program Files/Nuke14.1v6/python.exe' -m pip install OpenImageIO==3.0.3.1 --prefix C:/Users/Administrator/asd

Inside Nuke's script editor:

@mmozeiko
mmozeiko / !README.md
Last active April 20, 2025 05:32
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@tobi08151405
tobi08151405 / MyColorpicker.py
Last active January 14, 2025 18:16
Colorpicker for PyQt5
# (c) Teigigutesiegel, 2021
# used code from https://gist.github.com/sjdv1982/75899d10e6983b878f63083e3c47b39b, copyright (c) 2017 Sjoerd de Vries
"""
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@kstkn
kstkn / 00-intro.md
Created March 2, 2021 00:53 — forked from mdo/00-intro.md
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@KelSolaar
KelSolaar / hsv_pseudo_rrt.tcl
Last active February 23, 2021 06:08
HSV - Pseudo RRT
set cut_paste_input [stack 0]
version 12.1 v1
push $cut_paste_input
Colorspace {
illuminant_in ACES
primary_in ACES
bradford_matrix true
name ACES_to_sRGB_Colorspace
selected true
xpos -193
@KelSolaar
KelSolaar / drt_cubes.tcl
Created February 22, 2021 06:04
DRT Cubes
set cut_paste_input [stack 0]
version 12.1 v1
push $cut_paste_input
Camera2 {
translate {2 1.5 2}
rotate {-30 45 0}
focal 30
name Camera
selected true
xpos -186
@francois-durand
francois-durand / Fastcore_presentation.ipynb
Created February 8, 2021 20:12
Fastcore_presentation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
@kiding
kiding / HDRGainMap.swift
Last active April 19, 2025 03:13
Extracting HDR Gain Map from iOS 14.1+ (iPhone 12+) photos
import UIKit
import MobileCoreServices.UTCoreTypes
if #available(iOS 14.1, *) {
let input = Bundle.main.url(forResource: "IMG_0037", withExtension: "HEIC")!
let output = FileManager().temporaryDirectory.appendingPathComponent("IMG_0037.GAIN_MAP.BMP")
let source = CGImageSourceCreateWithURL(input as CFURL, nil)!
// urn:com:apple:photo:2020:aux:hdrgainmap
let dataInfo = CGImageSourceCopyAuxiliaryDataInfoAtIndex(source, 0, kCGImageAuxiliaryDataTypeHDRGainMap)! as Dictionary