Skip to content

Instantly share code, notes, and snippets.

View CookiePLMonster's full-sized avatar

Silent CookiePLMonster

View GitHub Profile
@CookiePLMonster
CookiePLMonster / SafeShutdown.py
Created February 25, 2019 18:13
Safe Shutdown Script
#!/usr/bin/env python3
from gpiozero import Button, LED, OutputDevice
import os
from signal import pause
import subprocess
from time import sleep
resetPin = 2
ledPin = 14
powerenPin = 4
@CookiePLMonster
CookiePLMonster / randimage.py
Last active February 21, 2019 21:01
Random shuffle on image pixels (based on https://stackoverflow.com/a/52437794/9214270)
import scipy.ndimage
import scipy.misc
import numpy as np
import sys
import os.path
if len(sys.argv) < 2:
exit(1)
numShuffles = 1 if len(sys.argv) < 3 else int(sys.argv[2])
@CookiePLMonster
CookiePLMonster / SafeShutdown.py
Created January 2, 2019 10:54
MegaPi modified Safe Shutdown
#!/usr/bin/env python3
from gpiozero import Button, LED
import os
from signal import pause
import subprocess
resetPin = 2
ledPin = 14
powerenPin = 4
hold = 2
//
// Generated by Microsoft (R) D3DX9 Fragment Linker 5.04.00.2904
//
// Parameters:
//
// float4x3 BoneWorldViewT[70];
// float4 FogParams;
// float3 LightAmbientDown;
// float3 LightAmbientUp;
// float3 LightDiffuse;
@CookiePLMonster
CookiePLMonster / skin-shader.fx
Created June 22, 2018 12:51
CRC2005 skinning shader
//
// Generated by Microsoft (R) D3DX9 Fragment Linker 5.04.00.2904
//
// Parameters:
//
// float4x3 BoneWorldViewT[70];
// float4 FogParams;
// float3 LightAmbientDown;
// float3 LightAmbientUp;
// float3 LightDiffuse;
@CookiePLMonster
CookiePLMonster / auralux2-critsec.md
Created June 14, 2018 20:24
Auralux Constellations

All memory addresses are in relation to the latest public executable (SHA-1: 8CADA155720C5D05596D0838D014E3E018F0708B).

With Application Verifier enabled, an unitialized critical section shows up:

=======================================
VERIFIER STOP 00000210: pid 0x2AA8: Critical section not initialized. 

	14A16FBC : Critical section address. Run !cs -s <address> to get more information.
	1418EFE0 : Critical section debug info address.
@CookiePLMonster
CookiePLMonster / sincos.cpp
Last active January 7, 2018 01:21
SSE2 sincos VS15.5.2 issue
#include <iostream>
#include <cmath>
// Compile in Release, x86
// /arch:IA32, /fp:fast
// Resulting code contains SSE opcodes and calls ___libm_sse2_sincosf_
int main()
{
float val = 0.0f;
std::cin >> val;