Skip to content

Instantly share code, notes, and snippets.

View antonk52's full-sized avatar
🏠
βšͺοΈπŸ”΄βšͺ️

Anton Kastritskii antonk52

🏠
βšͺοΈπŸ”΄βšͺ️
View GitHub Profile
@antonk52
antonk52 / lsp.lua
Created February 18, 2023 19:23
merge lsp definition results from multiple LSP servers into a single result
vim.keymap.set('n', 'gd', function()
vim.lsp.buf_request_all(
0,
'textDocument/definition',
vim.lsp.util.make_position_params(),
function(res)
if #res == 0 then
return vim.notify("No definitions under cursor", vim.log.levels.WARN)
else
-- req_all result to location list format
188K β”œβ”€β”€ scheduler
192K β”œβ”€β”€ image-size
192K β”œβ”€β”€ jest-worker
+ 196K β”œβ”€β”€ cacache
204K β”œβ”€β”€ asn1.js
+ 212K β”œβ”€β”€ expand-brackets
216K β”œβ”€β”€ browserify-zlib
224K β”œβ”€β”€ @hapi
+ 224K β”œβ”€β”€ @xtuc
232K β”œβ”€β”€ public-encrypt
@antonk52
antonk52 / vimconf-2021-slides.md
Last active October 30, 2021 11:53
Vimconf-2021-slides

DIY quality of life improvements

Myself

  • Web & developer tooling
  • Cannot get into mechanical keyboards
  • Write vim plugins when bored

Why

@antonk52
antonk52 / ripgrep-jsonify.js
Created August 17, 2021 16:19
parse `rg --json` output and output as unified json array to be able to work with it using `jq`
let string = '';
process.stdin.on('data', data => {
string += data;
});
process.stdin.on('close', data => {
const map = parseString(string)
.filter(t => t.type === 'match')
.map(x => x.data.submatches[0].match.text)
.reduce((acc, el) => {
β–² ./rome test internal/compiler/lint/rules/
⚠ Running compile on internal/browsers-db/regions.json seems to be taking longer than expected. Have been waiting for 3s.
internal/binary-transport/RSERWriterBase.ts:484:8 tests/unhandledRejection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
βœ– Don't know how to serialize the object UIDPath<lint/ts/useTsExpectError/reject/1/lint_ts_useTsExpectError.ts> to RSER
483 β”‚ throw new Error(
> 484 β”‚ pretty`Don't know how to serialize the object ${val} to RSER`,
β”‚ ^
window:
opacity: 1
padding:
x: 0
y: 0
decorations: 'none'
font:
normal:
family: 'Fira Code'
@antonk52
antonk52 / readme.md
Created February 15, 2021 09:25
Keyborads

Keyboard notes

Stuff to look for

  • Low Profile Red Cherry MX switches
  • iso layout is a must
  • no function keys row
  • arrow keys

Assembled

@antonk52
antonk52 / main.vim
Created January 12, 2021 10:17
get a dictionary of colors in colorscheme in vimscript
" {
" \ 'Comment': {
" \ 'guifg': '#123456',
" \ 'ctermfg': '8'
" \ }
" \ }
let color_dict = {}
" ['SpecialKey xxx ctermfg=8 guifg=#65737e']
let color_list = split(execute('highlight', 'silent!'), '\n')
/**
* To be used by babel-codemod to fix the global promise prototype patch
*
* @see https://www.npmjs.com/package/babel-codemod
* @see https://github.com/neoclide/coc.nvim/issues/2637
*/
import {types as t} from '@babel/core';
import type {PluginObj, NodePath, PluginPass} from '@babel/core';
type FFF = [NodePath<t.CallExpression>, t.Expression];
@antonk52
antonk52 / rome-out
Created October 25, 2020 19:21
cannot start rome server when working on rome
~/Documents/dev/personal/rome feat/optional-call-expressions-fix* 25s
β–² ./rome start
Building trunk
! This command has been hidden. Consider its usage to be experimental and do not expect support or
β„Ή No running daemon found. Starting one...
net.js:1292:20 internalError/fatal INTERNAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
βœ– Permission denied for
/var/folders/_p/0j0qxd9964j7ly9tzp6z1y2d_r242z/T/rome/10.0.4-beta-dev-wait.sock