Skip to content

Instantly share code, notes, and snippets.

@yavorski
yavorski / builtin-compl.lua
Created June 4, 2024 06:55 — forked from MariaSolOs/builtin-compl.lua
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)
@yavorski
yavorski / rust-command-line-utilities.markdown
Created May 23, 2024 11:15 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@yavorski
yavorski / what-forces-layout.md
Created December 16, 2021 00:23 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@yavorski
yavorski / gh-search-user-pulls.md
Created April 14, 2021 20:17
Search for pull requests from a given user in Gitgub
  • is:pr involves:yavorski
  • https://github.com/search?q=is%3Apr+involves%3Ayavorski
@yavorski
yavorski / gnome-fractional-scalling.sh
Created April 13, 2021 16:58
gnome-fractional-scalling
#!/usr/bin/env bash
# wayland
$ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
# x11
$ gsettings set org.gnome.mutter experimental-features "['x11-randr-fractional-scaling']"
# reset on both x11/wayland
$ gsettings reset org.gnome.mutter experimental-features
@yavorski
yavorski / wsl-nat-fix.ps1
Created January 29, 2021 15:45
WSL NAT FIX
# Add to -> Task Scheduler
# WSL 2 TPC NETWORK FORWARDING
# Introduction
# With the introduction of WSL 2 Beta, Microsoft has made changes to the system architecture.
# The changes include changing from the default bridged network adapter to a hyper-v virtual network adapter.
# The implementation was not completed during the launch of the beta program. This makes accessing of network resources under WSL 2 complex.
# The work around is to forward the TCP ports of WSL 2 services to the host OS.
# The virtual adapter on WSL 2 machine changes it's ip address during reboot which makes it tough to implement a run once solution.
" WSL yank support
" ==============================================================
" change this path according to your mount point
let s:clip = '/mnt/c/Windows/System32/clip.exe'
if executable(s:clip)
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif
@yavorski
yavorski / fix-ts-space.sh
Created May 5, 2020 21:41
TypeScript set output indentation to 2 spaces FIX
#!/usr/bin/env bash
sed -i 's/indentStrings = \["", " "\]/indentStrings = \["", " "\]/g' node_modules/typescript/lib/*.js
grep "indentStrings =" node_modules/typescript -R
@yavorski
yavorski / terminal-control.sh
Created March 20, 2020 00:25 — forked from bcap/terminal-control.sh
Useful terminal control characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
# Change the linux part above and in the Exec line if a different kernel is used
[Action]