Skip to content

Instantly share code, notes, and snippets.

View meshula's full-sized avatar
💭
Exploring liminal spaces

Nick Porcino meshula

💭
Exploring liminal spaces
View GitHub Profile
@meshula
meshula / fractalscape.pyxl
Created September 14, 2020 02:16
fractalscape.pyxl
// Scripts, variables, and constants here are visible to all modes
let fake_phi = 0
def Render(p, ϕ, height, horizon, scale_height, distance, screen_width, screen_height):
// precalculate viewing angle parameters
const sinphi = sin(ϕ + fake_phi)
const cosphi = cos(ϕ + fake_phi)
fake_phi += 0.1
@meshula
meshula / usd_conda.md
Last active October 2, 2020 02:08
USD conda
conda create -n otio-py38 python=3.8
conda activate otio-py38
conda install -c anaconda cmake
#conda install -c anaconda jinja2 # for USD
python -m pip install PySide2 PyOpenGL
#conda install -c rdonnelly vs2019_win-64 # developer command prompt for VS2019
#Build your projects
@meshula
meshula / clean_git_repository.bash
Created January 15, 2021 22:54 — forked from ymollard/clean_git_repository.bash
Clean a git repository by deleting history and data of old deleted files
#!/bin/bash
# This script, executed at the root of a git repository, deletes traces of every old file in this repository, index + blob on all branches
# It can take 10-30 minutes to run and will print regular warning stating than some references are unchanged
# time ./clear_git_repositor.bash >cleaning.log
# We need several passes to clean files renamed multiple times (git log --find-renames prevents its deletion for each renaming)
# MAXIMUM_PASSES should be more than the maximum number of renamings/movings for any file, if not then we might keep some traces of former files
MAXIMUM_PASSES=10 # Maximum number of passes
#include <iostream>
#include <assert.h>
#include <vector>
template<class T>
struct Func{};
// std::func replacement without dynamic memory allocation (captures are limited to 48 bytes)
// this could be extended to support captures >48 bytes... of course, with a bit more of logic
// and some state.
@meshula
meshula / character_anim.md
Created May 11, 2021 21:54
Character animation notes

Character Animation

@meshula
meshula / dinput8_joystick.cpp
Created May 16, 2021 19:28 — forked from t-mat/dinput8_joystick.cpp
DirectInput Joystick class
#include <windows.h>
#include <stdio.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dxguid.lib")
class DiJoyStick {
public:
@meshula
meshula / usd-adoption.md
Created May 19, 2021 22:18
notes on usd adoption
  • on Windows, pip largely works for PySide2, but PySide2 is poorly supported and mostly broken under conda. Mixing and matching pip and conda is a bad practice.
  • in a non-studio environment, Qt is problematic outside of the GPL3 environment.
  • usdview is great, but if Python, or Qt, or PySide2 provide challenges, the onboarding process to USD involves a large effort
  • no low-dependency usdview is available
  • boost is a barrier to adoption due to well documented versioning issues (e.g., it is in vfxplatform as a configuration difficulty) and an onboarding-unfriendly build system
  • tbb is a barrier outside of the DCC environment, as it is Yet Another threading system that may be at odds with either a developer's own tasking system, or a system native one such as Apple's Grand Central Dispatch. It is very easy to induces oversubscription problems with TBB in practice.
  • lack of standard cookbooks. there are multiple community efforts, but no acknowledged best practice sources
  • Python is highly adopted in Fil
@meshula
meshula / rusty-cli.md
Last active May 11, 2023 13:31
Rust rewrites of command line tools
@meshula
meshula / zig-pypi.py
Created July 13, 2021 17:25
publish zig to pypi
# This is not original code, it's from https://github.com/ziglang/zig-pypi
# this copy's purpose is to add comments in order to understand how it works
import os
import hashlib
import urllib.request
from email.message import EmailMessage
from wheel.wheelfile import WheelFile, get_zipinfo_datetime
from zipfile import ZipInfo, ZIP_DEFLATED
import libarchive # from libarchive-c