This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dithering matrices. | |
// See https://en.wikipedia.org/wiki/Ordered_dithering | |
__constant float indexMatrix2x2[] = { | |
0.25, 0.75, | |
1.00, 0.50 | |
}; | |
__constant float indexMatrix4x4[] = { | |
0.0625, 0.5625, 0.1875, 0.6875, | |
0.8125, 0.3125, 0.9375, 0.4375, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# /home/user/runit/service/pulseaudio/check | |
. $(dirname $0)/common.sh | |
exec $pulse --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MINIAUDIO_IMPLEMENTATION | |
#include <miniaudio.h> | |
#include <stdio.h> | |
ma_uint32 first_frame; // frame to start looping | |
ma_uint32 last_frame; // frame to end looping (exclusive) | |
ma_uint32 num_frames; // number of frames to loop | |
void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I spent an entire evening getting JIT debug symbols to work in GDB. | |
* Here is a minimal example to get you started. | |
* Have fun! | |
*/ | |
#include <errno.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |