Skip to content

Instantly share code, notes, and snippets.

View zachlewis's full-sized avatar

zachlewis

  • Method Studios
View GitHub Profile
@mmozeiko
mmozeiko / !README.md
Last active July 22, 2024 13:03
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).

@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 June 29, 2024 16:42
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
@MrLixm
MrLixm / maxrgb_lottes.py
Last active November 21, 2020 17:00
Implementation of Lottes(2016) Tonemapping.
import logging
import colour
import numpy as np
from oiio import OpenImageIO as oiio
# ---------------------------------------------------------
def lerp(x, y, a):
@zachlewis
zachlewis / build_test_ocio2_config.py
Last active July 17, 2021 23:00
OCIO 2.0 test config
import PyOpenColorIO as ocio
import numpy as np
import colour as colour
from six import string_types
__version__ = "2020.11.08.0"
OUTPUT = "/tmp/test_config.ocio2"
@sobotka
sobotka / stuffs.py
Created July 12, 2020 21:09
Film Like Curve Bezier Stuffs
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy
import math
# Return value as scalar or array. Shamelessly borrowed from
# Colour-science.org.
def as_numeric(obj, as_type=numpy.float64):