Skip to content

Instantly share code, notes, and snippets.

View lancelet's full-sized avatar
🖖
Reconfiguring the Primary Power Coupling

Jonathan Merritt lancelet

🖖
Reconfiguring the Primary Power Coupling
View GitHub Profile
@lancelet
lancelet / macos-haskell-run-vulkan-triangles.sh
Created July 8, 2019 10:11
Build and run the Haskell vulkan-triangles example on MacOS.
#!/usr/bin/env bash
#
# File: macos-haskell-run-vulkan-triangles.sh
#
# Haskell Vulkan on MacOS example:
# Build and run the vulkan-triangles GLFW example.
#
# The purpose of this script is to automate building and running the
# vulkan-triangles GLFW example. There are some half-baked instructions
# for MacOS available here:
@lancelet
lancelet / utah-teapot.py
Created September 27, 2020 03:42
Attempt at a Utah Teapot loader
# Crappy Utah Teapot loader script for Blender 2.90.1
import bpy
from mathutils import Vector
def create4x4patch(points):
surface_data = bpy.data.curves.new('wook', 'SURFACE')
surface_data.dimensions = '3D'
# set points per segments (U * V)
@lancelet
lancelet / format.hs
Last active May 16, 2021 09:44
Ormolu + cabal-fmt formatter and checker
#!/usr/bin/env cabal
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- cabal:
ghc-options:
-O2 -threaded -rtsopts "-with-rtsopts=-N -T"
-Wall -Wcompat -Wincomplete-record-updates
-Wincomplete-uni-patterns -Wredundant-constraints
@lancelet
lancelet / bartosz-nerd-snipe.hs
Created January 26, 2021 05:44
The "No Monty" problem (posed by Bartosz Milweski)
#!/usr/bin/env cabal
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{- cabal:
build-depends:
base
@lancelet
lancelet / wgpu_context.rs
Created January 7, 2025 07:53
wgpu + WASM + winit
//! Creates WGPU context that must run async.
//!
//! Three important parts of the WGPU API are async functions:
//! - Creating a new WGPU Instance.
//! - Requesting a new WGPU Adapter.
//! - Creating a WGPU Device and Queue.
//!
//! In non-web applications, we would like to block on these functions. However,
//! for WASM (web) usage, we cannot block.
//!