Skip to content

Instantly share code, notes, and snippets.

@luciditee
luciditee / traverse.c
Created August 13, 2024 02:28
Cross-platform (POSIX and Win32) recursive directory and file traversal example in C99
// Recursive directory and file traversal
// I don't make any claim to the code below, as it's hacked together from various publicly-available examples
// Targeting gnu99/c99
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
@luciditee
luciditee / keybase.md
Created May 16, 2017 21:08
Keybase.io authentication.

Keybase proof

I hereby claim:

  • I am sigtau on github.
  • I am sigtau (https://keybase.io/sigtau) on keybase.
  • I have a public key whose fingerprint is 7F57 3277 705E 7D00 83A3 3141 B890 145C 1836 1236

To claim this, I am signing this object:

@luciditee
luciditee / ScreenShake.cs
Last active February 22, 2017 02:28
A simple Unity script designed to shake the screen both via rotation and position.
/*
* Unity Screen Shake: A simple script designed to shake the
* attached transform using rotation and position; usually parented
* to a camera.
*
* Copyright 2016-2017 Will Preston & Die-Cast Magic Studios, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@luciditee
luciditee / BatchBurner.cs
Last active June 16, 2018 17:09
Batch Burner, a script designed to reduce static mesh draw calls in Unity scenes with a large number of static mesh entities.
/*
* Unity Batch Burner: A script designed to reduce static mesh draw calls automatically in scenes
* with a large amount of static geometry entities.
*
* Copyright 2016-2017 Will Preston & Die-Cast Magic Studios, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@luciditee
luciditee / unroller.cpp
Created August 14, 2016 23:12
Tests the speed of unrolling a 1024 element loop using pointer arithmetic vs. a nested for loop and outputs the result.
#include <iostream>
#include <cmath>
#include <ctime>
using namespace std;
int array[256][4] = {
{ 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 },
{ 13, 14, 15, 16 },
// "Useless Box" program code by Will Preston
// Made for class assignment with the Savannah College of Art & Design
// Advanced Physical Computing, Spring 2016.
#include <Servo.h>
// Defines are used in place of consts for globals because they compile
// to a more compact size in program memory.
// DEBUG_LED defines pin 13 as an area you can connect an LED to view
// when the program state changes (i.e. when the switch is thrown).
#define UB_SWITCH_READ A1