Skip to content

Instantly share code, notes, and snippets.

View ggcrunchy's full-sized avatar

Steven Johnson ggcrunchy

View GitHub Profile
@snoj
snoj / index.js
Created May 24, 2023 23:48
IPFS livestreaming
import bodyParser from 'body-parser';
import express from 'express'
import * as _ from 'lodash';
import * as IPFS from 'ipfs-client';
import Queue from 'promise-queue';
import xmlp from 'fast-xml-parser';
import { readFileSync } from 'fs';
const app = express()
const port = 3000
@superqix
superqix / sfxr.lua
Created June 25, 2020 01:54
A port of LÖVE's SFXR library to Solar2D for generated sound effects
-- sfxr.lua
-- original by Tomas Pettersson, ported to Lua by nucular
-- ported to Solar2D by ponywolf
--[[
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@graphitemaster
graphitemaster / T0.md
Last active July 2, 2023 12:26
Vulkan Tutorial

Tutorial 0

What is Vulkan

Vulkan is a low-overhead, cross-platform 3D graphics and compute API.

Vulkan targets

Vulkan targets high-performance realtime 3D graphics applications such as games and interactive media across multiple platforms providing higher performance and lower CPU usage.

@urraka
urraka / stb.c
Last active January 21, 2024 00:20
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#include "stb_image.h"
#include "stb_image_write.h"
@HoraceBury
HoraceBury / shadow.lua
Created April 27, 2015 05:30
Create a drop shadow
local function shadow( width, height, size )
local g = display.newGroup()
g.x, g.y = display.contentCenterX, display.contentCenterY
display.newRect( g, 0, 0, width+size, height+size ).fill = {1,1,1,0}
display.newRect( g, 0, 0, width, height ).fill = {0,0,0}
local c = display.capture( g )
g = display.remove( g )
@Shchvova
Shchvova / _readme.md
Last active April 11, 2022 21:27
Planets shader for Corona

#Corona planet shader v0.1#

Alt text

###Instructions###

  1. Download and unpack this gist into folder
  2. Add this assets two images and name them "red.jpg" and "[blue.jpg] (http://i.imgur.com/V3Tw97g.jpg)" in same folder (you will have to download and rename them)
  3. Open project in Corona Simulator 🤘
@Flexi23
Flexi23 / gist:1713774
Created January 31, 2012 23:27
GLSL 2D vector buffer in a texture with a custom floating point precision
/*
These are the helper functions to store and to restore a 2D vector with a custom 16 floating point precision in a texture.
The 16 bit are used as follows: 1 bit is for the sign, 4 bits are used for the exponent, the remaining 11 bit are for the mantissa.
The exponent bias is asymmetric so that the maximum representable number is 2047 (and bigger numbers will be cut)
the accuracy from 1024 - 2047 is one integer
512-1023 it's 1/2 int
256-511 it's 1/4 int and so forth...
between 0 and 1/16 the accuracy is the highest with 1/2048 (which makes 1/32768 the minimum representable number)
@donny-dont
donny-dont / aligned_allocator.cpp
Created December 13, 2011 09:11
An aligned allocator for placing SIMD types in std::vector
#ifdef _WIN32
#include <malloc.h>
#endif
#include <cstdint>
#include <vector>
#include <iostream>
/**
* Allocator for aligned data.