Skip to content

Instantly share code, notes, and snippets.

View abenezeradane's full-sized avatar

Abenezer Adane abenezeradane

View GitHub Profile
@abenezeradane
abenezeradane / LICENSE
Created October 27, 2025 05:51 — forked from binji/LICENSE
pokegb.cc w/o macros
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
@abenezeradane
abenezeradane / Application.h
Last active August 16, 2022 02:52
Simple SDL2 window creation implementation in C
#ifndef APPLICATION_H
#define APPLICATION_H
#include <stdio.h>
#include <SDL2/SDL.h>
typedef struct Application {
SDL_Window* window;
char* title;
@abenezeradane
abenezeradane / Queue.h
Created July 30, 2022 01:45
Basic Queue implementation in C, what I'm currently using when designing an ECS
#ifndef QUEUE_H
#define QUEUE_H
#define NULL_ITEM 65536
typedef struct Queue {
unsigned int front, rear, size;
unsigned int capacity;
unsigned int* array;
} Queue;
@abenezeradane
abenezeradane / Application.h
Last active August 6, 2022 03:05
Custom boilerplate C++ code to create a window using the Windows API (Win32).
#include <windows.h>
#include <stdbool.h>
enum {
KEY_UNKNOWN,
KEY_MOUSE_LEFT,
KEY_MOUSE_RIGHT,
KEY_MOUSE_MIDDLE,
@abenezeradane
abenezeradane / gridtools.java
Last active August 6, 2022 03:04
Java Swing class used to draw grids
package Gridtools;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
public class Grid extends JPanel {
protected static final long serialVersionUID = 0L;
protected static final int MARGIN_SIZE = 5;
@abenezeradane
abenezeradane / vcxsrv.sh
Last active June 29, 2022 21:34
Setting DISPLAY environmental variable for VcXsrv Windows X Server to work
#!/usr/bin/env bash
# Export DISPLAY to VcXsrv Windows X Server
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
echo "Updated Display: ${DISPLAY}"
exit 0
#SHELL
@abenezeradane
abenezeradane / external.sh
Last active June 29, 2022 21:34
UNIX external storage mount for Windows Subsystem for Linux (WSL)
#!/usr/bin/env bash
# Determine if it's a network storage or external hard drive
read -p "(N)etwork or (D)rive? " -n1 external
echo ""
# Blank input check
if [ -z "$external" ]; then
echo 'Inputs cannot be blank!'
exit 0