Skip to content

Instantly share code, notes, and snippets.

@CptPotato
CptPotato / userContent.css
Created January 29, 2023 11:31
GitHub Dark dimmed theme for Firefox reader mode
@-moz-document url-prefix("about:reader") {
:root {
--mono-font: Fira Code;
--fg: rgb(173, 186, 199);
--bg: rgb(34, 39, 46);
--bg-light: rgb(45, 51, 59);
}
body {
color-scheme: dark !important;
@CptPotato
CptPotato / gruvbox_stealth.toml
Last active January 24, 2023 09:31
gruvbox stealth helix theme
"type" = "yellow"
"constant" = "purple"
"constant.numeric" = "purple"
"constant.character.escape" = "orange"
"string" = "olive"
"string.regexp" = "blue"
"comment" = { fg = "grey0", modifiers = ["italic"] }
"variable" = "fg0"
"variable.builtin" = "blue"
"variable.parameter" = "fg0"
@CptPotato
CptPotato / ehsv_color_picker.glsl
Last active June 27, 2022 07:15
exposure based hsv color picker (shader toy)
vec3 exposure_offset(vec3 col, float e) {
const float RANGE = 4.0; // dynamic exposure range, exponential
const float EBLACK = pow(2.0, -RANGE); // min exposure offset
const float EWHITE = pow(2.0, RANGE); // max exposure offset
const float BLACK = EBLACK / (1.0 + EBLACK); // tonemapped remap values
const float WHITE = EWHITE / (1.0 + EWHITE);
const float BWNORM = 1.0 / (WHITE - BLACK);
e = pow(2.0, e * RANGE); // exposure
@CptPotato
CptPotato / everforest_hc.toml
Last active October 3, 2023 14:08
Everforest Dark theme (with increased contrast) for Helix editor
# Everforest (higher contrast variant)
# Author: CptPotato
# Original Author:
# URL: https://github.com/sainnhe/everforest
# Filename: autoload/everforest.vim
# Author: sainnhe
# Email: [email protected]
# License: MIT License
@CptPotato
CptPotato / shadow_3x3_pcf.hlsl
Created May 13, 2021 18:34
shadow PCF filtering (3x3 box blur with bilinear filtering)
// shade four shadow samples independently
float4 shade_shadow_4(float4 occluder_depth, float4 receiver_depth, float2 bias)
{
return saturate((occluder_depth - receiver_depth - bias.x) / bias.y);
}
// pcf sampling with 3x3 box blur + bilinear filtering (16 samples)
float sample_shadow_3x3(float2 shadow_uv, float2 shadow_res, float ref_depth, float2 bias)
{
float2 shadow_pixel = 1.0f / shadow_res; // pixel size
@CptPotato
CptPotato / ddg_filter.js
Created September 19, 2020 11:51
Search result filter for duckduckgo.com
function inject_filter(
blacklist,
scroll_threshold = 512
)
{
let lastscroll = 0;
function err(msg)
{
document.onscroll = null;