Skip to content

Instantly share code, notes, and snippets.

---
BasedOnStyle: Microsoft
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'false'
colorscheme onehalflight
"colorscheme gruvbox
"set background=dark
" Disable bell
set visualbell
set t_vb=
set t_u7=
set tabstop=4
@riicchhaarrd
riicchhaarrd / hash.c
Created December 28, 2023 13:06
Fowler–Noll–Vo hash function
// https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
typedef uint64_t u64;
typedef uint32_t u32;
u32 fnv1a_32(const char *str)
{
@riicchhaarrd
riicchhaarrd / decimate.py
Last active November 5, 2023 05:26
blender batch decimate
# blender.exe -b -P decimate.py -- --input_file crate.glb --output_file output.glb
import bpy
import sys
import math
args = sys.argv
input_file = None
output_file = None
i = 0
import re
class Struct:
def __init__(self, name, body):
self.name = name
self.references = []
self.body = body
def __str__(self) -> str:
return f'{self.name}: {self.references}'
@riicchhaarrd
riicchhaarrd / soundfix.cpp
Created July 22, 2022 20:31
cod2 soundfix
PMIXERCONTROLDETAILS soundFuncFix(const char* search)
{
HMIXER phmx;
//probably wouldn't be a bad idea to also ZeroMemory this structure
if (waveInGetNumDevs() < 1 || mixerGetNumDevs() < 1 || mixerOpen(&phmx, 0, 0, 0, 0))
{
return (PMIXERCONTROLDETAILS)-1;
}
else
{
@riicchhaarrd
riicchhaarrd / my-theme.el
Created March 28, 2022 09:14
custom emacs theme
(deftheme my
"My theme for Emacs")
(custom-theme-set-faces
'my
'(font-lock-function-name-face ((t (:foreground "#523112" :weight normal))))
'(font-lock-string-face ((t (:foreground "#606060"))))
'(font-lock-type-face ((t (:foreground "#044333"))))
'(font-lock-constant-face ((t (:foreground "blue"))))
'(font-lock-builtin-face ((t (:foreground "#70312a"))))
@riicchhaarrd
riicchhaarrd / gist:a180d92346682f49c6ca8cb38322f3d0
Created March 28, 2022 07:41
fix linux fonts aliasing / hinting
~/.Xresources
-------------------------
Xft.autohint: 0
Xft.antialias: 1
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.dpi: 96
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
--------------------------
@riicchhaarrd
riicchhaarrd / gtk.css
Created March 27, 2022 07:31
change scrollbar style -> .config/gtk-3.0/gtk.css
scrollbar slider {
min-width: 15px;
min-height: 15px;
border: 2px solid transparent;
border-radius: 0px;
}
@riicchhaarrd
riicchhaarrd / select-all.el
Created March 26, 2022 18:10
emacs CTRL-A select all and cursor keys
(defun custom-select-all ()
(interactive)
;; (message "test %s" (key-description (string (read-event nil nil 2))))
(mark-whole-buffer)
(setq tmp (read-event nil nil 0.3))
(if tmp
(progn
(when (string= "left" tmp)
(deactivate-mark)
)