Skip to content

Instantly share code, notes, and snippets.

View tilkinsc's full-sized avatar
▶️
Working on Lua.NET

Cody Tilkins tilkinsc

▶️
Working on Lua.NET
View GitHub Profile
@tilkinsc
tilkinsc / ocd.bat
Created December 19, 2017 00:33
Open current directory batch file
REM opens current directory. Stick in C:\Windows or somewhere in path to use it easier.
REM Purpose is just to save typing and promote productivity
@echo off
explorer %cd%
exit /b
@tilkinsc
tilkinsc / incbin.c
Created January 29, 2018 17:40 — forked from mmozeiko/incbin.c
Include binary file with gcc
#include <stdio.h>
#define STR2(x) #x
#define STR(x) STR2(x)
#define INCBIN(name, file) \
__asm__(".section .rodata\n" \
".global incbin_" STR(name) "_start\n" \
".type incbin_" STR(name) "_start, @object\n" \
".balign 16\n" \
Considerate Jessica Grey
A Short Story
by Mr Pseudonym
Jessica Grey had always loved urban Camborne with its jealous, jittery jungle. It was a place where she felt anxious.
She was a considerate, patient, beer drinker with sloppy eyelashes and wobbly fingers. Her friends saw her as an obedient,
old ogre. Once, she had even saved a steady baby that was stuck in a drain. That's the sort of woman he was.
Jessica walked over to the window and reflected on her chilly surroundings. The clouds danced like shouting foxes.
@tilkinsc
tilkinsc / WOL.c
Last active June 25, 2018 17:37
A simple WINDOWS ONLY example using winsock to wake on lan WOL in C
//example mac: b1:27:eb:b4:a0:9e
//example hex mac: 0xb1, 0x27, 0xeb, 0xb4, 0xa0, 0x9e
//put example max in place of #define MAC, make sure to end with a , like shown below
//also update IP, and PORT if you need to
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>
// 32-bit Instructions Types
op a b c d f
_____________________
R-Type 6 5 5 5 5 6
I-type 6 5 5 16
J-Type 6 24
Bit Length
R-Types
@tilkinsc
tilkinsc / reg_ext_cmd.reg
Created August 17, 2018 05:42
Windows 10 - Adds a `Open with cmd` option to right click menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Shell\cmd]
@="@shell32.dll,-8506"
"Extended"=""
"ShowBasedOnVelocityId"=dword:00639bc8
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\Shell\cmd\command]
@="cmd.exe /K pushd \"%V%"
@tilkinsc
tilkinsc / using.bat
Last active September 7, 2018 06:45
Batch file you can stick in C:\Windows or C:\Windows\System32 after setting paths in environment variables, which called will add those paths to PATH: using %ExamplePath% adds C:\Whatever;C:\Whatever2 to %PATH%
REM Created by: http://github.com/tilkinsc
REM Use the -v or /v switch anywhere to see the command issued.
REM Adds supplied path to the %PATH% variable, supports multiple paths per variable
REM Usage: using %EnvVariable% [-v]
REM Example:
REM set examp=C:\Whatever;C:\Whatever2
REM using %examp% -v
@tilkinsc
tilkinsc / floor.c
Created October 9, 2018 01:24
Flooring a float in C
/**
* floating points:
* 32 bit number
*
* 0-22 mantissa
* 23-30 exp
* 31 sign
*
* Theory: You can use the exp potion to determine the offset and null out the bits to produce a floored number.
@tilkinsc
tilkinsc / dds_texture_loader.c
Created September 8, 2017 07:02
Loading a DDS file DXT1 DXT3 DXT5 opengl
GLuint texture_loadDDS(const char* path) {
FILE* f;
f = fopen(path, "rb");
if(f == 0)
return 0;
// make sure this is a dds
char filecode[4];
fread(&filecode, 1, 4, f);
@tilkinsc
tilkinsc / sound.c
Created January 4, 2019 13:12
Using wav files with OpenAL
ALuint* sound_load_wav(const char* path) {
ALuint* sound = 0;
WaveData* w_data = 0;
ALenum error = 0;
w_data = wave_load(path);
if(w_data == 0) {
fprintf(stderr, "Failed to load wave file.\n");
goto exit;