Instantly share code, notes, and snippets.
🚀
Let's go!
THE WIZARD MUST BE STOPPED.
- Wedel, Germany
- 12:09
(UTC +01:00) - https://hmans.dev
- @hmans@norden.social
- in/hmans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
# Normalize EOL for all files that Git considers text files. | |
*text=autoeol=lf | |
# 3D models | |
*.3dmfilter=lfsdiff=lfsmerge=lfs-text | |
*.3dsfilter=lfsdiff=lfsmerge=lfs-text | |
*.blendfilter=lfsdiff=lfsmerge=lfs-text | |
*.c4dfilter=lfsdiff=lfsmerge=lfs-text | |
*.colladafilter=lfsdiff=lfsmerge=lfs-text | |
*.daefilter=lfsdiff=lfsmerge=lfs-text |
hmans /mastodon_bookmarklet.md
Last activeDecember 22, 2022 03:11
Mastodon Follow/Interact Bookmarklet This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
import{render}from"https://deno.land/x/resvg_wasm@0.2.0/mod.ts"; | |
import{Page,PageData}from"lume/core.ts"; | |
importsatori,{SatoriOptions}from"npm:satori"; | |
/* We never want our beautiful PNGs to have a layout :-) */ | |
exportconstlayout=undefined; | |
/* Load fonts. We can't use variable fonts unfortunately. */ | |
constinter=awaitDeno.readFile("./src/fonts/Inter-Regular.ttf"); | |
constinterBold=awaitDeno.readFile("./src/fonts/Inter-Bold.ttf"); |
hmans /useFrameEffect.ts
CreatedSeptember 4, 2022 15:48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
import{useFrame}from"@react-three/fiber" | |
import{useRef}from"react" | |
/* TODO: Extract this into hmans/things or similar */ | |
exportfunctionuseFrameEffect<T>( | |
dependencyCallback:()=>T, | |
callback:(args:T)=>void, | |
renderPriority=0 | |
){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
/* A simple lens dirt texture shader for Three.js. Grab a lens dirt texture, | |
plug it into the tDirt uniform, and watch things get diirrtttttaayyyyeee. | |
Like, really dirty. It can get very confusing if your monitor also has | |
fingerprints, believe me. | |
- hendrik@mans.de 🚀 */ | |
exportconstLensDirtShader={ | |
uniforms:{ | |
tDiffuse:{value:null}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
import*asTHREEfrom"three" | |
exporttypeInstance={ | |
object:THREE.Object3D | |
color?:THREE.Color | |
index:number | |
data:any | |
} | |
/* Our ManagedInstancedMesh class that we can use with just plain old Three.js */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
root =true | |
[*] | |
end_of_line =lf | |
insert_final_newline =true | |
charset =utf-8 | |
indent_style =tab | |
indent_size =4 | |
trim_trailing_whitespace =true |
hmans /BobTheBuilder.cs
Last activeApril 27, 2024 23:26
A basic pipeline for performing headless Unity builds for multiple platforms at once. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
/* This needs to live in a folder named "Editor", or it won't work. Doesn't have to be named | |
"BobTheBuilder", though. Name it whatever you want! */ | |
usingSystem; | |
usingUnityEditor; | |
usingUnityEngine; | |
publicclassBobTheBuilder | |
{ | |
/* List of scenes to include in the build */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
doctype html | |
html | |
head | |
title My App | |
metaname="viewport"content="width=device-width, initial-scale=1.0" | |
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' | |
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' | |
= csrf_meta_tags | |
= csp_meta_tag |
NewerOlder