Skip to content

Instantly share code, notes, and snippets.

View DeityLamb's full-sized avatar
🎭
confused

Oleksii DeityLamb

🎭
confused
View GitHub Profile
@DeityLamb
DeityLamb / alacritty.yml
Last active January 11, 2024 13:39
alacritty - nord theme
# Colors (Nord)
colors:
# Default colors
primary:
background: '#071019'
foreground: '#D8DEE9'
# Normal colors
normal:
black: '#3B4252'
#!/bin/bash
# [DEPENDENCIES]
# dunst (https://github.com/dunst-project/dunst)
# pulseaudio (https://github.com/pulseaudio/pulseaudio)
# faba-icon-theme (https://github.com/snwh/faba-icon-theme)
# [USAGE]
@DeityLamb
DeityLamb / floating.sh
Last active July 13, 2023 16:51
run application as floating in swaywm
#!/bin/bash
# [usage examples]
# sh ./floating.sh kitty -e "htop"
# sh ./floating.sh kitty -e "ranger"
$@ &
swaymsg "for_window [pid=\"$!\"] floating enable"
@DeityLamb
DeityLamb / .dunstrc
Last active July 22, 2022 09:33
My wofi configs
width=400
lines=10
term=alacritty
prompt=Type an applicattion
allow_images=true
@DeityLamb
DeityLamb / split-markdown.util.ts
Last active June 24, 2023 12:00
Split a markdown without breaking a code block
function splitMarkdown(str: string, limit: number): string[] {
return str.match(new RegExp(`.*([^]){1,${limit}}(\n)?$`, 'gm')).reduce((acc, curr) => {
const lastValue = acc.at(-1);
if (!lastValue) return [curr];
const heads = lastValue.match(/```.*/g) as string[] || [];
// If the number of heads is even or 0, then all code blocks are closed
{
"_comment_": [
"Please do not automate the download and installation of Forge.",
"Our efforts are supported by ads from the download page.",
"If you MUST automate this, please consider supporting the project through https://www.patreon.com/LexManos/"
],
"id": "1.16.2-forge-33.0.61",
"time": "2020-09-10T18:57:08+00:00",
"releaseTime": "2020-09-10T18:57:08+00:00",
"type": "release",
{
"_comment_": [
"Please do not automate the download and installation of Forge.",
"Our efforts are supported by ads from the download page.",
"If you MUST automate this, please consider supporting the project through https://www.patreon.com/LexManos/"
],
"spec": 0,
"profile": "forge",
"version": "1.16.2-forge-33.0.61",
"json": "/version.json",
@DeityLamb
DeityLamb / clamp.md
Created April 27, 2024 23:02
The clamp function using only mathematical operators

(((x + min + |x - min|) / 2) + max - |((x + min + |x - min|) / 2) - max|) / 2

$\frac{(\frac{x + \min + |x - \min|}{2} + \max - |(\frac{x + \min + |x - \min|}{2} - \max|)}{2}$

image