Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View hmans's full-sized avatar
🚀
Let's go!

Hendrik Mans hmans

🚀
Let's go!
THE WIZARD MUST BE STOPPED.
View GitHub Profile
@hmans
hmans /.gitattributes
Last activeMarch 2, 2023 19:03
Git configuration for Godot 4.0
# 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
hmans /mastodon_bookmarklet.md
Last activeDecember 22, 2022 03:11
Mastodon Follow/Interact Bookmarklet

All desktop browsers (I think/hope) support bookmarklets -- bookmarks that contain JavaScript code which is run when you select them.This bookmarklet makes it easier to follow users or interact with toots from other Mastodon instances by passing their URLs back to your home instance, where you can then follow/interact with them normally.

The bookmarklet:

#"mastodon.social";if(document.location.hostname==host){alert("Already on your own instance!")}else{document.location=("https://"+host+"/authorize_interaction?uri="+encodeURIComponent(document.location))}
@hmans
hmans /og_images.tmpl.tsx
CreatedNovember 12, 2022 14:46
Automatic OpenGraph Images for Lume
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");
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
){
@hmans
hmans /LensDirtShader.js
Last activeMarch 20, 2022 19:44
Lens Dirt Shader for Three.js
/* 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},
@hmans
hmans /ManagedInstancedMesh.ts
Last activeJanuary 12, 2021 11:41
Managed Instanced Mesh API
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 */
@hmans
hmans /.editorconfig
CreatedAugust 13, 2020 10:04
Unity♥️ Git
root =true
[*]
end_of_line =lf
insert_final_newline =true
charset =utf-8
indent_style =tab
indent_size =4
trim_trailing_whitespace =true
@hmans
hmans /BobTheBuilder.cs
Last activeApril 27, 2024 23:26
A basic pipeline for performing headless Unity builds for multiple platforms at once.
/* 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 */
@hmans
hmans /application.html.slim
CreatedMarch 27, 2020 10:59
Rails 6.0 Slim Application Layout
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

[8]ページ先頭

©2009-2025 Movatter.jp