title: Know Your Tools sub_title: Work Smarter, Not Harder author: Munif Tanjim theme: name: terminal-dark override: execution_output: colors: background: black
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function process() { | |
| try { | |
| await using helper = new PythonHelper("dmm-hashlist-sync"); | |
| using py = await helper.client(); | |
| const res = await py.send({ cmd: "parse_torrent_title", data: [{ hash: '', title: '' }] }); | |
| // ... | |
| } catch (err) { | |
| console.error(err); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local mod = {} | |
| local result = { | |
| statusline = {}, | |
| tabline = {}, | |
| winbar = {}, | |
| } | |
| local heirline = require("heirline") | |
| local heirline_eval_statusline = heirline.eval_statusline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("config.lsp.custom").patch_lsp_settings("sumneko_lua", function(settings) | |
| settings.Lua.diagnostics.globals = { "hs", "spoon" } | |
| settings.Lua.workspace.library = {} | |
| local hammerspoon_emmpylua_annotations = vim.fn.expand("~/.config/hammerspoon/Spoons/EmmyLua.spoon/annotations") | |
| if vim.fn.isdirectory(hammerspoon_emmpylua_annotations) == 1 then | |
| table.insert(settings.Lua.workspace.library, hammerspoon_emmpylua_annotations) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export NVM_DIR="${HOME}/.local/share/nvm" | |
| PATH="./node_modules/.bin:${PATH}" | |
| if [ -d "${NVM_DIR}" ]; then | |
| __node_global_bins=("nvm" "node" $(find ${NVM_DIR}/versions/node -maxdepth 3 -path '*/bin/*' -type l -print0 2>/dev/null | xargs -0 -n1 basename | sort | uniq)) | |
| __init_nvm() { | |
| unset -f ${__node_global_bins[@]} >/dev/null 2>&1 | |
| unset __node_global_bins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local Input = require("nui.input") | |
| local event = require("nui.utils.autocmd").event | |
| local function nui_lsp_rename() | |
| local curr_name = vim.fn.expand("<cword>") | |
| local params = vim.lsp.util.make_position_params() | |
| local function on_submit(new_name) | |
| if not new_name or #new_name == 0 or curr_name == new_name then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "custom": true, | |
| "id": "gruvbox_dark", | |
| "name": "Gruvbox Dark", | |
| "highlights": { | |
| "attribute": "#d79921", | |
| "background": "#1d2021", | |
| "comment": "#a89984", | |
| "definition": "#fbf1c7", | |
| "keyword": "#fb4934", |
Keybindings to use with the vscode-neovim extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin; | |
| create function on_update_timestamp_trigger() | |
| returns trigger as $$ | |
| begin | |
| new."updated_at" = current_timestamp; | |
| return new; | |
| end; | |
| $$ language 'plpgsql'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| command_exists() { | |
| type "${1}" >/dev/null 2>&1 | |
| } | |
| select_github_release() { | |
| local -r repo="${1}" |
NewerOlder