Skip to content

Instantly share code, notes, and snippets.

View TannerRogalsky's full-sized avatar
💯
P I X E L S

Tanner Rogalsky TannerRogalsky

💯
P I X E L S
View GitHub Profile

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2018. Updated December 29 2019.

Windows

API Share
Direct3D 11+ 85% (+5%)
Direct3D 10.1 8.5% (-1.5%)
Direct3D 10.0 5.5% (-2.5%)
Direct3D 9 1% (-1%)
@s-ol
s-ol / glitch_cube.c
Last active April 11, 2020 22:42
program interpreting random parts of itself as textures for a cube
// $ gcc -o glitch_cube glitch_cube.c -lglfw -lGL -lGLU
#include <GLFW/glfw3.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void cubeFaceX(float side) {
glNormal3f(side, 0.0f, 0.0f);
<!DOCTYPE html>
<html>
<head><title>Fizzlefade</title></head>
<body>
<canvas id="framebuffer" width="320" height="200"></canvas>
<script type="text/javascript">
/* Fizzlefade using a Feistel network.
@bkaradzic
bkaradzic / notes_on_header_files.md
Last active December 8, 2023 03:24
Notes on header files

Notes on header files

After over 20 years working with C/C++ I finally got clear idea how header files need to be organized. Most of the projects in C++ world simply dump everything in .h file, and most of my C++ code was organized this way. Lately I started to separate function declaration from implementation as it was done in C. Now .h headers are exclusevely intended for function and class declaration with doxygen documentation style comments. Inline implementation of functions, class method implementation, etc. goes into .inl headers or .cpp files.

For example .h file would contain only declaration and doxygen style documentation comment:

	/// Convert size in bytes to human readable string.
	void prettify(char* _out, int32_t _max, uint64_t _value)
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@josefnpat
josefnpat / readme.md
Last active April 7, 2024 11:39
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@slime73
slime73 / sdl-metal-example.m
Last active September 9, 2021 10:53
SDL + Metal example
/**
* This software is in the public domain. Where that dedication is not recognized,
* you are granted a perpetual, irrevokable license to copy and modify this file
* as you see fit.
*
* Requires SDL 2.0.4.
* Devices that do not support Metal are not handled currently.
**/
#import <UIKit/UIKit.h>
@alexeisavca
alexeisavca / ReactIgnore
Last active March 12, 2023 12:24
A simple component to make ReactJs ignore subtrees
var React = require('react/addons');
var ReactIgnore = {
displayName: 'ReactIgnore',
shouldComponentUpdate (){
return false;
},
render (){
return React.Children.only(this.props.children);
}
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 15, 2024 23:50
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@LPGhatguy
LPGhatguy / demo.lua
Last active August 29, 2015 14:02
OpenGL function loader for LuaJIT. This is a fixed up version of slime73's original code. See demo.lua for usage.
local glfw = require("glfw3") --Let's say we have a magic GLFW3 binding there!
local openGL = require("opengl")
openGL.loader = glfw.GetProcAddress
openGL:import()
--and somewhere else
local vbo = ffi.new("GLuint[1]")
gl.GenBuffers(1, vbo)
gl.BindBuffer(GL.ARRAY_BUFFER, vbo[0])
gl.BufferData(GL.ARRAY_BUFFER, ffi.sizeof(vertices), vertices, GL.STATIC_DRAW)