Skip to content

Instantly share code, notes, and snippets.

View vinnydiehl's full-sized avatar

Vinny Diehl vinnydiehl

View GitHub Profile
@vinnydiehl
vinnydiehl / ~|bin|sync-config
Created October 3, 2023 20:08
[gistribution]
#!/bin/sh
git -C ~/.config/nvim pull --rebase https main
echo
git -C ~/.config/zsh pull --rebase https main
@vinnydiehl
vinnydiehl / magic.c
Last active July 28, 2023 05:41
Get a number input, take no nonsense from the user
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <errno.h>
/**
* Sets terminal attributes to read input without echo and enter.
*/
void setTerminalAttributes() {
@vinnydiehl
vinnydiehl / README.md
Last active July 19, 2023 07:33
RuboCop pre-commit hook

To install this, run from the root of the repo:

curl https://gist.githubusercontent.com/vinnydiehl/716fca0f4eea5a55d0bcb2961ef40fd1/raw/928111c3ea7014ec36c26cbc4775ae679a5fe351/install.sh | sh
@vinnydiehl
vinnydiehl / convert-nerd
Created June 9, 2023 05:05
Script to convert Nerd Fonts from cheatsheet.nvim
#!/usr/bin/env ruby
results = Dir.glob("#{ARGV.first}/*").sort.map do |filename|
File.read(filename).split("\n").select { |ln| ln =~ /^\s+\(/ }.map do |ln|
name, code = ln.scan /(?<=")[\w\\x-]+(?=")/
code = code.sub("\\x", "0x").hex
"#{name.sub /^nf-/, ""} | #{[code].pack("U")}"
end
end.flatten
@vinnydiehl
vinnydiehl / README.md
Last active May 30, 2023 11:21
Paste markdown code blocks fast
@vinnydiehl
vinnydiehl / renderer.rb
Last active April 29, 2023 11:08
Proof-of-concept for drtiled rendering library
module Tiled
# Resolution of circle sprite used to make ellipses
RADIUS = 300
DIAMETER = 2 * RADIUS
class Renderer
attr_reader :tile_layers, :object_layers
def initialize(args, map)
@args = args
@vinnydiehl
vinnydiehl / rc.lua
Last active January 10, 2023 06:29
awesome wm config WIP
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
@vinnydiehl
vinnydiehl / Test File || |tmp|gistribute_spec|test.file
Last active July 24, 2023 12:58
[gistribution] public single file
Line 1
Line 2
ACPI Warning: For \_SB_.PCI0.P0P1.PRT: Return Package has no elements (empty) (20120320/nspredef-463)
pci0000:00: Requesting ACPI _OSC control (0x1d)
pci0000:00: ACPI _OSC request failed (AE_ERROR), returned control mask: 0x1d
ACPI _OSC control for PCIe not granted, disabling ASPM
# :TODO: Fix this shit
// :KLUDGE: I don't even know...
/*
:COMPILER: Fucking AMD!
The bits don't shift properly. Gonna need a regex.
*/