This file contains 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 shebang_regex = vim.regex([[^#!]]) | |
local blank_or_comment_line_regex = vim.regex([[^\s*\(#.*\)\?$]]) | |
local shellcheck_disable_regex = vim.regex([[^\s*#\s*shellcheck\s\+disable=\(\(SC\)\?\d\+\)\(,\(SC\)\?\d\+\)*\s*$]]) | |
local shellcheck_disable_pattern = "^%s*#%s*shellcheck%s+disable=([^%s]*)%s*$" | |
-- Searches a region of the buffer `bufnr` for a ShellCheck disable directive. | |
-- The search proceeds from `row_start` to `row_end`. | |
-- If `row_start` is greater than `row_end`, the region is effectively searched in reverse. | |
-- A table representing first directive that's found is returned, otherwise nil. | |
local find_disable_directive = function(bufnr, row_start, row_end) |
This file contains 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
module { | |
name: "neuron-autoindex", | |
version: "0.1.0", | |
description: "generate hierarchical indices for neuron notes", | |
authors: ["Maddison Hellstrom <maddy@na.ai>"], | |
license: "GPL-3", | |
}; | |
def invert_tags: | |
. |
This file contains 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 | |
# Copyright (c) 2018-2021 Maddison Hellstrom (github.com/b0o) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains 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
[Default Applications] | |
text/plain=kitty-nvim.desktop; | |
This file contains 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
function! MoveWindow(dir) | |
let l:orig_win = winnr() | |
let l:orig_buf = bufnr() | |
exe 'wincmd ' . a:dir | |
let l:dest_win = winnr() | |
let l:dest_buf = bufnr() | |
exe l:orig_win . 'windo hide buf' l:dest_buf | |
exe l:dest_win . 'windo hide buf' l:orig_buf | |
endfunction | |
nnoremap <M-S-h> :call MoveWindow('h')<Cr> |
This file contains 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
#compdef git-tag-version | |
# zsh completion for git-tag-version | |
_git-tag-version () { | |
_arguments -S -s "-h[usage]" "1:version-name" "2:from:__git_commits" "3:to:__git_commits" | |
} |
This file contains 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
#!/bin/bash | |
# Helper for yglu to assist with importing yaml files into the document | |
# root. | |
# | |
# Depends: yglu - https://github.com/lbovet/yglu/ | |
# | |
# Copyright (c) 2020-2021 Maddison Hellstrom <github.com/b0o>, MIT License. | |
set -euo pipefail |
This file contains 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 | |
shopt -s inherit_errexit | |
function main() { | |
local -i row_width=${1:-990} | |
local -i total_height=${2:-500} | |
local -i row_height=$((total_height / 4)) | |
local mods=".w${row_width}.h${row_height}.d" |
This file contains 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
const union = (...sets) => new Set(sets.flatMap(s => [...s])) | |
const intersection = (a, b, ...rest) => (rest.length ? intersection : (s => new Set(s)))([...a].reduce((acc, e) => b.has(e) ? [...acc, e] : acc, []), ...rest) | |
const difference = (...sets) => [...intersection(...sets)].reduce((acc, e) => !acc.delete(e) || acc, union(...sets)) | |
const leftDifference = (left, ...rights) => difference(left, intersection(left, union(...rights))) | |
const rightDifference = (...sets) => leftDifference(...sets.reverse()) |
This file contains 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
// ==UserScript== | |
// @name Auto darkmode | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Toggle darkmode on supported sites based on your OS's darkmode setting | |
// @author You | |
// @match https://www.tradingview.com/chart/* | |
// @match https://www.coinex.com/* | |
// @exclude https://www.coinex.com/assets/trading_chart/* | |
// @grant none |