Skip to content

Instantly share code, notes, and snippets.

View cnlohr's full-sized avatar

cnlohr cnlohr

View GitHub Profile
@cnlohr
cnlohr / testsecret.yml
Created February 5, 2025 04:02
workflow with manual dispatch and secret in environment - needs to be run manually - only works after committed to default branch
# So you don't pull your hair out, workflow dispatches must be in the default branch.
name: Secret Test
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
@cnlohr
cnlohr / fix_fft.h
Created October 31, 2024 22:24
Fixed point floating point header-only library
#ifndef FIX_FFT_H
#define FIX_FFT_H
int fix_fftr(short*, int, int);
int fix_fft(short fr[], short fi[], short m, short inverse);
#endif
#ifdef FIX_FFT_IMPLEMENTATION
@cnlohr
cnlohr / test.json
Last active August 19, 2023 19:31
test
{"schemaVersion":1,"label":"Exe Size","message":"21672\nminiosctest","color":"orange"}
@cnlohr
cnlohr / goertzels_dft_comparison.c
Created January 14, 2023 19:29
Comparison of Goertzel's and DFT algorithms.
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define CNFG_IMPLEMENTATION
#include "rawdraw_sf.h"
void HandleKey( int keycode, int bDown ) { }
void HandleButton( int x, int y, int button, int bDown ) { }
@cnlohr
cnlohr / nreal notes.txt
Last active December 13, 2022 14:20
Nreal:AIR custom EDIDs (96 Hz,etc.) EDID custom mode timings
sudo xrandr --output DP-2 --newmode BB44 44 1920 1952 1968 2000 280 289 294 350 +hsync -vsync
It's wacky, but does work. Repeats screens
You can de/increase Y safely.
sudo xrandr --output DP-2 --newmode CC44 44 1920 1952 1968 2000 1080 1089 1094 1110 +hsync -vsync
Rate works at 44 and 66+
@cnlohr
cnlohr / xorg.conf
Last active October 22, 2022 10:40
Gettning NVIDIA to allow you to set arbitrary modes in xrandr
# Hacky, only works with startx, tested, october 2022 with 470.57.01
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
@cnlohr
cnlohr / SDL_add_logging.c
Created August 11, 2022 00:28
Make SDL Apps Emit Verbose Logging for Debugging Purposes
void SDL_LogVerbose()
{
// You can C&P theis code into yours before main.
SDL_LogSetPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_DEBUG);
}
@cnlohr
cnlohr / sandbox_esp32_s2_frequency_and_pro_alone_gpio.c
Created July 17, 2022 11:14
ESP32-S2 Experiments with pro alone GPIO + Overclocking.
#include <stdio.h>
#include "esp_system.h"
#include "swadgeMode.h"
#include "hdw-led/led_util.h"
#include "hal/gpio_types.h"
#include "soc/system_reg.h"
#include "soc/dport_access.h"
#include "soc/dedic_gpio_reg.h"
#include "soc/rtc_cntl_reg.h"
#include "esp_log.h"
@cnlohr
cnlohr / graph.c
Created July 14, 2022 04:40
Example command-line graphing tool for rawdraw.
#define CNFG_IMPLEMENTATION
#include "rawdraw_sf.h"
void HandleKey( int keycode, int bDown ) { }
void HandleButton( int x, int y, int button, int bDown ) { }
void HandleMotion( int x, int y, int mask ) { }
void HandleDestroy() { }
#include <pthread.h>