Skip to content

Instantly share code, notes, and snippets.

View chasemarangu's full-sized avatar
📚
studying

Chase Marangu chasemarangu

📚
studying
View GitHub Profile
@jcubic
jcubic / cdn.md
Last active January 26, 2026 14:01
How to setup a literally free CDN
@companje
companje / map.glsl
Created January 23, 2018 22:46
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@Softwave
Softwave / README.md
Last active November 27, 2025 14:05
Fibonacci Program

Fib

Simple fibonacci number calculator.

Usage: fib nth Fibonacci number

@jaredpalmer
jaredpalmer / all-html-elements.html
Created September 17, 2018 16:13
All HTML Elements
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 Test Page</title>
</head>
<body>
<div id="top" class="page" role="document">
<header role="banner">
@major
major / gist:2037116
Created March 14, 2012 15:10
pi in domain names
$ p=$(echo "scale=64;4*a(1)"|bc -l);for i in $( seq 4 $((${#p} - 1)) );do echo -n "${p:0:$i}.com: ";echo `dig +short ${p:0:$i}.com|xargs`||echo;done
3.14.com: 98.124.198.1
3.141.com:
3.1415.com:
3.14159.com: 74.94.75.217
3.141592.com: 72.32.231.8
3.1415926.com:
3.14159265.com: 209.51.133.66
3.141592653.com: 184.173.91.228
3.1415926535.com: 68.178.232.99
@ybakos
ybakos / GraphicGlDemoActivity.java
Created November 27, 2012 00:52
A simple example of using an Android Renderer to illustrate OpenGL ES boilerplate.
/* GraphicGlDemoActivity.java
* Author: Yong Bakos
* Since: 11/26/2012
* Thanks to:
* Cube: http://intransitione.com/blog/create-a-spinning-cube-with-opengl-es-and-android/
* OpenGL Boilerplate: http://www.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/
*/
package com.humanoriented.sudoku;
import java.nio.ByteBuffer;
@antiboredom
antiboredom / index.html
Created December 15, 2014 16:36
A simple example showing how to save animated gifs from p5.js sketches, using https://github.com/jnordberg/gif.js
<html>
<head>
<script src="gif.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/p5.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/addons/p5.dom.js"></script>
<script src="sketch.js"></script>
</head>
<body>
<p>First, allow camera access.<p><p>Then click once to start recording, and another time finish recording and make a gif.</p>
</body>
@hyrious
hyrious / github-raw-pdf.user.js
Created November 6, 2023 03:08
Open raw link for PDF files on GitHub.
// ==UserScript==
// @name GitHub PDF Raw Link
// @namespace raw-pdf.github.hyrious.me
// @match https://github.com/*
// @grant none
// @version 1.0
// @author hyrious
// @description Replace PDF file's link with its raw link
// @require https://cdn.jsdelivr.net/npm/selector-set@1.1.5/selector-set.js
// @require https://cdn.jsdelivr.net/npm/selector-observer@2.1.6/dist/index.umd.js
@devshgraphicsprogramming
devshgraphicsprogramming / bait.md
Created October 23, 2023 22:48
Don't even dream of reprojecting last frame depth for occlusion culling, you will fail!

Originally posted as a reply to: https://gist.github.com/reduz/c5769d0e705d8ab7ac187d63be0099b5

Turned into a gist due to high likelihood of deletion. Also edited down to not include irrelevant trolling as to be useful to someone else considering Depth Reprojection.

Yes I know SSR and Parallax Corrected Shadowmaps work, but the consequences of errors in those depth tests aren't as high.

Lack of Generality (oh the irony)

You yourself state that this is general purpose engine, how is a technique that will have trouble with:

  • deformables (cloth, vegetation, skinned meshes, etc.)
anonymous
anonymous / gist:7200880
Created October 28, 2013 17:20
Processing motion blur
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;