Skip to content

Instantly share code, notes, and snippets.

import wave
sampledata = "0709F5F4060D090D02F3F5F5F5F5F5070B090B090B080C02000D04F8F5F8F5FD0B090909080B00F5F8F8F8F8F7FAF503FFF7F80409070709FEF7F9F9F8FBF9030B0B0C0B100C0B0508FF05000400F5F9FCFD060F16051411140CF401FFFCEDFBF5F5EDF800F0F1F5F7F8040000F9FDFAF9F5FEFAFDFBFF00FE00FC03FFFFF700ECE7EFE9E5D1C8BCAEA1959BA0A6B3BDC7C7D6D6CACAC0B1A29B91908E8A8B888A8683888C979CADADBBBDBBBCB4B7ADA79F919EDB27352D222C30303A37433C423A3C383A392C2F2F2E36373D3237332D2F1E1F19171714111716232C2F37405050535B55544C473F3D3027282226282E2A37433F3E37413F4141332D2626201F1E28292E363F44474D4F514C4C49393128251B1407090B0F16182725363A3A4244474A4545433D3C373C372E3A2A3329312F2D322D322D2F373F353A3F4E4A4F50504E5049433133220FD9A29C94A4A4ACB1C3CDD8E0EDF9F9FDFDFCF3E5E5D6CFC4C2BEB6BFC0C6BFD2D1DADBE5E0A89590969292928F918E938F8F90918D8C908B8A88888683858685848688878A8D9191919394929294918E909193B1DD032A42504A454143443F38372F282A27211B212A2A313A3D3C3F3F3F3C3A33271F131C0F0F0B0F0C0F1F27333E464D545B605B595C4F4E41393629321F251718251B27272E282E323C3F3E403A3F474B4F454
r(t)^2 = x(t)^2 + y(t)^2 + z(t)^2
x(t+h) = x(t) + h * f(t) * -x(t) / r(t)^2
y(t+h) = y(t) + h * f(t) * -y(t) / r(t)^2
z(t+h) = z(t) + h * f(t) * -z(t) / r(t)^2
x(t+h) - x(t) = h * f(t) * -x(t)/r(t)^2
x'(t) = -f(t)x(t)/r(t)^2
#version 120
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#version 120
#if defined(VERTEX)
#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
@Sgeo
Sgeo / simuleyes_sbs_auto.glsl
Created February 18, 2023 09:03
Work in progress on DOSBox-X shader to conver SimulEyes -> SBS
#version 120
// Developed by tyrells
// Based on Marat Tanalin's algorithm: https://tanalin.com/en/articles/integer-scaling/
uniform vec2 rubyInputSize;
#if defined(VERTEX)
#if __VERSION__ >= 130
@Sgeo
Sgeo / opengl_vr_from_chatgpt.c
Created December 4, 2022 02:41
This code was written by ChatGPT
#include <Windows.h>
#include <MinHook.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <OVR_CAPI_GL.h>
// Declaration of the original function.
typedef void (__stdcall *glBegin_t)(GLenum);
glBegin_t original_glBegin;
effect focus<a>
ctl focus(a : a): a
fun vl-fst(f: a -> focus<r> b): (((a, c)) -> focus<r> (b, c))
fn(pair)
match pair
(a, c) -> (f(a), c)
fun vl-snd(f: a -> focus<r> b): (((c, a)) -> focus<r> (c, b))
fn(pair)
@Sgeo
Sgeo / mastervolume.js
Created January 5, 2021 21:41
Add a setVolume() function to affect all AudioContexts
// Based on https://github.com/notthetup/webaudio-volume-control/blob/master/mastervolume.js
(function() {
window.setVolume = function(){};
let origAudioContextConstructor = window.AudioContext;
window.AudioContext = function(options) {
let origAudioContext = new origAudioContextConstructor(options);
let masterGain = origAudioContext.createGain();
masterGain.connect(origAudioContext.destination);
let origSetVolume = window.setVolume;
@Sgeo
Sgeo / irixswextract.c
Last active August 11, 2020 01:55 — forked from camthesaxman/irixswextract.c
tool to extract IRIX software packages
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
struct Archive
LEGAL DISCLAIMER
This product is meant for educational purposes only. Any resemblance to real persons, living or dead is purely coincidental. Void where prohibited. Some assembly required. Batteries not included. Contents may settle during shipment. Use only as directed. No other warranty expressed or implied. Do not use while operating a motor vehicle or heavy machinery. This is not an offer to sell securities. Apply only to affected area. May be too intense for some viewers. Do not stamp. For recreational use only. Do not disturb. All models over 18 years of age. No user-serviceable parts inside. Freshest if eaten before date on carton. Subject to change without notice. Times approximate. Simulated picture. Please remain seated until the ride has come to a complete stop. Breaking seal constitutes acceptance of agreement. For off-road use only. As seen on TV. One size fits all. Contains a substantial amount of non-tobacco ingredients. Colors may, in time, fade. Slippery when wet.
For office use only. Not