Skip to content

Instantly share code, notes, and snippets.

View calebarg's full-sized avatar

Caleb Barger calebarg

View GitHub Profile
@calebarg
calebarg / jblow.vim
Created February 24, 2025 07:37
Jonathan Blow vim colorscheme
" jblow.vim - A Vim color scheme based on Jonathan Blow's theme
" Clear existing highlights
hi clear
if exists("syntax_on")
syntax reset
endif
set background=dark
@calebarg
calebarg / chess_engine.py
Last active September 10, 2023 18:38
Chess engine written in python
##! Toy chess engine
##! Caleb Barger -- 09/10/23
from enum import Enum
class PieceType(Enum):
pawn = 0
night = 1 # Yes, this is the wrong knight but avoids having 2 'K's.
bishop = 2
rook = 3
@calebarg
calebarg / multithreading_example.zig
Last active August 26, 2024 14:54
ZIG multithreading example
//!
//! multithreading_example.zig
//! Caleb Barger
//! 06/27/2023
//! Zig 0.13.0
//!
//! Minified ZIG version of Casey Muratori's multithreading example from Handmade Hero.
//!
const std = @import("std");
@calebarg
calebarg / chunk_loader.py
Created May 23, 2023 04:55
Prototype chunk loader for my voxel game
# PROTOTYPE CHUNK LOADING ALOGRITHM THING
# Caleb Barger - 05/22/2023
import time
import os
CHUNK_CAP = 100
d_chunk_poses = [
(0, 1, 0), # Up
(0, -1, 0), # Down
@calebarg
calebarg / build.zig
Last active May 19, 2023 13:13
Zig 0.11.0 - Raylib importC example
// Example: minimal build.zig setting up raylib.
// Caleb Barger - 05/18/2023
const std = @import("std");
const rl = @import("raylib/src/build.zig");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
@calebarg
calebarg / tetris.py
Created December 29, 2022 00:15
tetris with ncurses
"""
" Caleb Barger - 04/17/2022
"""
import sys
import time
import curses
COLS = 11
ROWS = 17