Skip to content

Instantly share code, notes, and snippets.

View tinylucid's full-sized avatar

Filip Miletic tinylucid

View GitHub Profile
@tinylucid
tinylucid / InfiniteGrid.shader
Created October 12, 2023 08:50 — forked from bgolus/InfiniteGrid.shader
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@tinylucid
tinylucid / hash.c
Created June 16, 2023 12:14
PCG_RNG hash function
// https://www.reedbeta.com/blog/hash-functions-for-gpu-rendering/
uint pcg_hash(uint input)
{
uint state = input * 747796405u + 2891336453u;
uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
return (word >> 22u) ^ word;
}
{
@tinylucid
tinylucid / Settings.10x_settings
Created March 18, 2023 19:50
10x config (beta)
# Format: <SettingName>: <Settingvalue>
# Setting name must appear at start of line and there must be whitespace after the colon.
# Multiple values can be comma separated or on subsequent lines.
#
# General
#
# Open the last workspace opened when starting 10x
OpenLastWorkspaceOnStartup: false
;;; naysayer-theme.el --- Aftereight theme for Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@tinylucid
tinylucid / fonttools.py
Created November 30, 2022 11:04
python script for fixing TTF font height
import os
import sys
from fontTools import ttLib
def run(argv):
if len(argv) != 2:
print("USAGE: %s <font-file>" % argv[0])
sys.exit(1)
{
"name": "Forsythe",
"author": "Alex Forsythe",
"variables":
{
"base_bg": "hsl(0, 0%, 3%)",
"base_fg": "hsl(0, 0%, 80%)",
"highlight_fg": "hsl(40, 100%, 70%)",
"highlight_fg_dim": "hsl(40, 80%, 70%)",
@tinylucid
tinylucid / Firefox font rendering.md
Last active October 6, 2023 22:53
fix that fuglt default font rendering on Firefox on Windows

Enter about:config and change the following configurations:

Key Value
gfx.font_rendering.cleartype_params.cleartype_level 0
gfx.webrenderer.all true
gfx.font_rendering.cleartype_params.rendering_mode 5
gfx.use_text_smoothing_setting true
@tinylucid
tinylucid / GPUOptimizationForGameDev.md
Created January 10, 2021 15:16 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for GameDev
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
std::vector<int> parse_input(std::string& in, char delimiter = ' ')
{
std::vector<int> result;
std::stringstream input_stream(in);
std::string parsed_number;
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <array>
#include <algorithm>
#include <cmath>
using Lines = std::vector<std::string>;