Skip to content

Instantly share code, notes, and snippets.

View erikyuzwa's full-sized avatar

Erik Yuzwa erikyuzwa

View GitHub Profile
@erikyuzwa
erikyuzwa / main.c
Created July 18, 2025 19:37
hello world using libtcod 2.1.1 and C
#define SDL_MAIN_USE_CALLBACKS
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include "libtcod.h" // Include the main libtcod header
#include <stdio.h>
#include <stdlib.h>
// Define console dimensions
#define SCREEN_WIDTH 80
#define SCREEN_HEIGHT 50
@erikyuzwa
erikyuzwa / CMakeLists.txt
Last active July 1, 2025 05:25
CMakeLists.txt for Raylib projects
# CMakeLists.txt project file for Raylib projects
#
cmake_minimum_required(VERSION 3.30)
project(hello_raylib_with_cmake C)
set(CMAKE_C_STANDARD 23)
# Include the command that downloads libraries
include(FetchContent)
@erikyuzwa
erikyuzwa / CMakeLists.txt
Last active July 15, 2025 15:21
CMakeLists.txt for SDL3 projects
# CMakeLists.txt project file for SDL3 projects
#
# NB: SDL_image, SDL_ttf and SDL_mixer are not yet tagged properly
# in github to be included via this fetch mechanism.
# As they are updated, I will endevour to keep this gist updated
cmake_minimum_required(VERSION 3.30)
project(hello_sdl3_with_cmake C)
set(CMAKE_C_STANDARD 23)
@erikyuzwa
erikyuzwa / CMakeLists.txt
Last active May 15, 2025 22:15
CMakeLists.txt for SDL2 projects (including SDL2_image, SDL2_ttf)
# CMakeLists.txt project file for SDL2 projects
#
cmake_minimum_required(VERSION 3.30)
project(hello_sdl2_with_cmake C)
set(CMAKE_C_STANDARD 23)
# Include the command that downloads libraries
include(FetchContent)
// Currently making use of the SDL3.1.0 Preview release
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
int main(int argc, char* argv[])
{
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
@erikyuzwa
erikyuzwa / wordpress-6-2-2-docker-compose.yml
Last active June 25, 2025 00:18
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#
#!/usr/bin/env ruby
# 1 pound = 0.453 kg
def pounds_to_kg(pounds = 0.00)
if (pounds < 1.0)
0.00
else
(pounds / 2.205).round(2)
end
end
@erikyuzwa
erikyuzwa / spring-boot-one-liner.md
Last active December 8, 2019 21:17
java spring project one liner from curl

setup

one liner for generating a new spring-boot project in the CURRENT folder

  • dependencies: devtools,web,data-jpa,security,session,h2,thymeleaf
  • project type: maven
  • packaging : war
curl https://start.spring.io/starter.zip -d packaging=war -d dependencies=devtools,web,data-jpa,security,session,h2,thymeleaf -d type=maven-project -d baseDir=. | tar -xzvf -
/**
* subscriptions data format:
* { eventType: { id: callback } }
*/
const subscriptions = { };
const getNextUniqueId = getIdGenerator();
function subscribe(eventType, callback) {
const id = getNextUniqueId();
@erikyuzwa
erikyuzwa / he_had_a_year_to_do_it_in.txt
Created April 1, 2018 19:57
he had a year to do it in
He had a year to do it in
So brushed the thought away,
A chap with half his energy
Might do it in a day.
A year! ‘Twas too ridiculous,
As everyone should find;
However, he would get it done
And have it off his mind.
But not today. A few months hence would suit him better still;