Skip to content

Instantly share code, notes, and snippets.

View JayLCypher's full-sized avatar
💭
:pepemeltdown:

John JayLCypher

💭
:pepemeltdown:
View GitHub Profile
@JayLCypher
JayLCypher / ringbuffer.h
Created March 30, 2025 16:35
A single-function operations style ringbuffer impl
#pragma once
#ifndef RB_H
#define RB_H
#include "types.h"
#include "memory.h"
#include "utility.h"
#define rb_new(T, N) \
struct { \
@JayLCypher
JayLCypher / commands.lua
Created August 25, 2024 19:39
A usercommand for Neovim that clears the Lsp.log file. Uses the same start as LspLog command from LspConfig, so that you have a new LspLogClear command.
vim.api.nvim_create_user_command("LspLogClear", function()
local lsplogpath = vim.fn.stdpath("state") .. "/lsp.log"
print(lsplogpath)
if io.close(io.open(lsplogpath, "w+b")) == false then vim.notify("Clearning LSP Log failed.", vim.log.levels.WARN) end
end, { nargs = 0 })
@JayLCypher
JayLCypher / fortune_cowsay.fish
Created August 13, 2024 12:07
A command for running fortune with cowsay that dynamically handles terminal width using tput.
# Fortune and Cowsay that uses tput to check for the width of the terminal.
if type -q fortune && type -q cowsay
fortune -o | cowsay -W (math (tput cols) - 3)
end
#include "include/tgraymath.h"
#include "include/raymath.h"
#include <stdio.h>
void print_vector2(Vector2 v) {
printf("Vector2: {%.6f, %.6f}\n", v.x, v.y);
}
void print_vector3(Vector3 v) {
printf("Vector3: {%.6f, %.6f, %.6f}\n", v.x, v.y, v.z);