Skip to content

Instantly share code, notes, and snippets.

View DDR0's full-sized avatar
🦇
Making Stuff

David Roberts DDR0

🦇
Making Stuff
View GitHub Profile
@DDR0
DDR0 / pshufb.mjs
Created September 12, 2023 06:29
pshufb for javascript
//Javascript/ECMAScript adaptation of the Intel pshufb instruction. I think.
//Does not work in-place. No zeroing. CC BY-NC-SA 2023 DDR0.
//Example:
/*
pshufb.num(0x0a0b0c0d,
0x01010303).toString(16).padStart(8, '0');
returns: '0c0c0a0a'
*/
@DDR0
DDR0 / shaders.c
Created December 14, 2020 00:07
water_distort_new
//in shaders.cfg:draw
set(textures, []),
if(liquid_textures[0], [
bind_texture(liquid_textures[0], 2),
set(uniform_commands.u_water_tex_0, 2),
add(textures, [liquid_textures[0]]),
]),
if(liquid_textures[1], [
bind_texture(liquid_textures[1], 3),
set(uniform_commands.u_water_tex_1, 3),
@DDR0
DDR0 / frogatto release tasks 2020-11-12.txt
Created November 12, 2020 22:27
frogatto release tasks
☐ Content Creation
☐ Shadow mechanics
☐ Make a few enemy variants that respond to light/shadow.
☐ Redo a variant of the mosquitos as moths?
☐ Make a bat which wakes up in the light.
☐ Make some puzzle mechanics around ligthing.
☐ Light-reactive switch
☐ Light-once switch
☑ Dark, unnavigatable shadow
☐ Particle Effects Upgrade
import scala.annotation.tailrec
// generic version
sealed trait List[A] {
@tailrec
final def length(counter: Int=0): Int =
this match {
case Pair(_, tail:List[A]) => tail.length(counter+1)
case End() => counter
Building: src/kre/CameraObject.cpp
In file included from src/kre/imgui_impl_opengl3.cpp:67:
src/kre/imgui_impl_opengl3.h:38:1: error: ‘IMGUI_IMPL_API’ does not name a type; did you mean ‘IMGUI_API’?
38 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
| ^~~~~~~~~~~~~~
| IMGUI_API
src/kre/imgui_impl_opengl3.h:39:1: error: ‘IMGUI_IMPL_API’ does not name a type; did you mean ‘IMGUI_API’?
39 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
| ^~~~~~~~~~~~~~
| IMGUI_API
@DDR0
DDR0 / little_dust_effect.cfg
Created April 15, 2020 02:21
little_dust_effect.cfg
{
"info": {
"affector": {
"max_deviation_x": 2.0,
"type": "randomizer"
},
"blend": "alpha_blend",
"blend_enable": true,
"blend_equation": "add",
"default_particle_height": 3.0,
@DDR0
DDR0 / blinks.txt
Created April 10, 2020 03:22
blink pattern presets
@DDR0
DDR0 / sketch_neon_1.c
Last active April 11, 2020 01:59
Blinky Patterns for the Arduino Uno - Now with button presses for modes!
#define END 0
#define START 1
#define BLINK 2
#define UBLINK 3
#define REPEAT 4
#define LOG_SEEK 0
#define LOG_EXEC 0
static const byte ledPin = 5;
@DDR0
DDR0 / signal_tap.py
Created September 7, 2019 05:55
Intercept and modify `pyqtSignal`s.
"""Provides signalTap, a generic class to transform a pyqtSignal.
Usage example: Intercept a spinbox's valueChanged signal.
```python
def __init__(self):
valueChangedTap = signalTap(lambda val:
(val * self.unitValue[self.siUnit],) )
self.valueChanged.connect(valueChangedTap.emit)
self.valueChanged = valueChangedTap
```
cam-json --control set - << EOF
{"ioMapping": {"combAnd": {"debounce": 0, "invert": 0, "source": "alwaysHigh"},
"combOr1": {"debounce": 1, "invert": 0, "source": "io1"},
"combOr2": {"debounce": 1, "invert": 0, "source": "io3"},
"combOr3": {"debounce": 0, "invert": 0, "source": "none"},
"combXOr": {"debounce": 0, "invert": 0, "source": "none"},
"delay": {"debounce": 0,
"delayTime": 0,
"invert": 0,
"source": "toggle"},