Skip to content

Instantly share code, notes, and snippets.

View duck2's full-sized avatar

Duck Deux duck2

View GitHub Profile

Bootstrapping Rust with xtensa support

Build xtensa llvm from here https://esp32.com/viewtopic.php?t=9226&p=38466

But add the X86 target like so

cmake ../llvm-xtensa -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja"
/* A Verilog VGA module without state machines or weird bit assignments.
* Works with 50MHz clock, 800x600@72Hz. */
module vga(clk, in_R, in_G, in_B, out_R, out_G, out_B, Hsync, Vsync, video_on, x, y);
input clk, in_R, in_G, in_B;
output wire out_R, out_G, out_B, Hsync, Vsync, video_on;
output reg[9:0] x, y;
/* counters. increment y at the start of hsync. reset x at the end of front porch. */
@llbit
llbit / ScenePresets.md
Last active July 9, 2021 18:24
Chunky Scene Presets

Clear Sunset

{"sunEnabled":true,"fogColor":{"red":0.42814502293337064,"green":0.5858024691358026,"blue":1.0},"fastFog":true,"transparentSky":false,"fogDensity":0.0,"sun":{"altitude":0.44879895051282753,"azimuth":1.2566370614359172,"intensity":1.4493430876832702,"color":{"red":1.0,"green":0.47843137383461,"blue":0.0}},"sky":{"skyYaw":0.0,"skyMirrored":true,"skyLight":0.8164494214249368,"mode":"GRADIENT","horizonOffset":0.1,"cloudsEnabled":false,"cloudSize":64.0,"cloudOffset":{"x":0.0,"y":128.0,"z":0.0},"gradient":[{"rgb":"FF9966","pos":0.0},{"rgb":"FFB77D","pos":0.19811320754716982},{"rgb":"FFFFB3","pos":0.5801886792452831},{"rgb":"D5ECEE","pos":0.8891509433962265},{"rgb":"EBFCFD","pos":1.0}]}}

Foggy Sunset

{"sunEnabled":true,"fogColor":{"red":0.42814502293337064,"green":0.5858024691358026,"blue":1.0},"fastFog":true,"transparentSky":false,"fogDensity":0.09523809523809523,"sun":{"altitude":0.6981317007977318,"azimuth":1.2566370614359172,"intensity":0.6916163486090415,"color":{"red":1.0,"gre
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 27, 2024 01:22
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@rygorous
rygorous / Stats.js
Created April 25, 2012 03:48
Half-space tri rasterizers in JS
// stats.js r9 - http://github.com/mrdoob/stats.js
var Stats=function(){var h,a,r=0,s=0,i=Date.now(),u=i,t=i,l=0,n=1E3,o=0,e,j,f,b=[[16,16,48],[0,255,255]],m=0,p=1E3,q=0,d,k,g,c=[[16,48,16],[0,255,0]];h=document.createElement("div");h.style.cursor="pointer";h.style.width="80px";h.style.opacity="0.9";h.style.zIndex="10001";h.addEventListener("mousedown",function(a){a.preventDefault();r=(r+1)%2;0==r?(e.style.display="block",d.style.display="none"):(e.style.display="none",d.style.display="block")},!1);e=document.createElement("div");e.style.textAlign=
"left";e.style.lineHeight="1.2em";e.style.backgroundColor="rgb("+Math.floor(b[0][0]/2)+","+Math.floor(b[0][1]/2)+","+Math.floor(b[0][2]/2)+")";e.style.padding="0 0 3px 3px";h.appendChild(e);j=document.createElement("div");j.style.fontFamily="Helvetica, Arial, sans-serif";j.style.fontSize="9px";j.style.color="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";j.style.fontWeight="bold";j.innerHTML="FPS";e.appendChild(j);f=document.createElement("div");f.style.position="relati