Skip to content

Instantly share code, notes, and snippets.

@vk2gpu
vk2gpu / gist:812d3fb654fe67c0ecc4801a0bd84a79
Created October 29, 2023 07:57
Shock Collar Remote on Arduino.
const uint32_t RemoteSecret = 0b0101111110011001;
const int PinTX = 8;
const int PinLED = LED_BUILTIN;
const int PreambleHighTime = 1370;
const int PreambleTotalTime = 2160;
const int BitOneHighTime = 725;
const int BitZeroHighTime = 225;
const int BitTotalTime = 1020;
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 2 columns, instead of 1. in line 3.
Word(s),Spoken Form (If Different)
nmap,N map
under-documented,under documented
nmap
admin
Cisco
Citrix
VPN
DNS
Minecraft
@vk2gpu
vk2gpu / main.c
Last active July 22, 2022 09:08
mySSTV, simple SSTV encoder
// clang main.c -std=c11 -O3 -lsndfile -lc -lm -o mySSTV
// reference: https://www.classicsstv.com/daytonpaper.pdf
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <memory.h>
@vk2gpu
vk2gpu / main.c
Last active January 27, 2020 09:22
#include <stdint.h>
#include <stdio.h>
#include <conio.h>
#include <6502.h>
#include <cx16.h>
#include "sine_tab.h"
#include "palette.h"
#include "tilemap.h"
eilogd@NEILO-MBA:~/Dev/test$ g++ test.cpp -O0 -o test -l pthread
neilogd@NEILO-MBA:~/Dev/test$ ./test
Expected value: 4000000
Non-volatile: 1530233
Volatile: 1362100
Atomic: 4000000
neilogd@NEILO-MBA:~/Dev/test$ ./test
Expected value: 4000000
Non-volatile: 1308157
Volatile: 1371573
!src "vera.inc"
SCANLINE_COUNT = $10 ; $11
FRAME_COUNTER = $12
FRAME_COUNTER_WAIT = $13
TEMP = $14
SCANLINE_COUNT = $10 ; $11
@vk2gpu
vk2gpu / fire-demo.asm
Created September 15, 2019 07:44
Commander x16 Fire Demo
!src "vera.inc"
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 60
; Zero page
LOOP_X = $00
LOOP_Y = $01
RAND_SEED_LO = $02
RAND_SEED_HI = $03
//KOSMO BIG BUTTON 2016 SAM BATTLE
//email address is computer@lookmumnocomputer.com
//look mum no computer
//lookmumnocomputer@gmail.com
//www.facebook.com/lookmumnocomputer
//ITS AN ABSOLUTE MESS BUT IT WORKS.... SORT OF....
//YOU NEED QUITE A CLEAN CLOCK TRIGGER SIGNAL. QUITE A SHORT PULSE!
//To make it work better add this circuit to the clock input :-
//https://www.cgs.synth.net/modules/cgs24_gatetotrigger.html
@vk2gpu
vk2gpu / gist:48f9aa7050655cd2fd2a3f85dfab7664
Created March 7, 2018 10:40
Win32 snippet for reading a file from the interwebs
const char* url = "https://downloads.sourceforge.net/project/ispcmirror/v1.9.1/ispc-v1.9.1-windows-vs2015.zip";
HINTERNET hInternet = ::InternetOpenA("httpRequest", INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, 0);
if(::InternetGoOnlineA(url, nullptr, 0))
{
HINTERNET hFileHandle = ::InternetOpenUrlA(hInternet, url, nullptr, 0, 0, 0);
DWORD requestStatusSize = sizeof(requestStatusSize);
DWORD requestStatus = 0;
::HttpQueryInfoA(hFileHandle, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &requestStatus, &requestStatusSize, nullptr);
[internal("SamplerState")]
struct SamplerState
{
AddressingMode AddressU;
AddressingMode AddressV;
AddressingMode AddressW;
FilteringMode MinFilter;
FilteringMode MagFilter;
float MipLODBias;
uint MaxAnisotropy;