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/lua | |
--[[* | |
* test case: cmus-notify status playing file path title hola artist qace album ok | |
* | |
* installation: | |
* - Set the status_display_program variable in cmus | |
* :set status_display_program=/path-to/cmus-notify.lua | |
* | |
* - Save the changes using |
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
HISTFILE="$HOME/.zsh_history" | |
HISTSIZE=50000 | |
SAVEHIST=10000 | |
## History command configuration | |
setopt extended_history # record timestamp of command in HISTFILE | |
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE | |
setopt hist_ignore_dups # ignore duplicated commands history list | |
setopt hist_ignore_space # ignore commands that start with space | |
setopt hist_verify # show command with history expansion to user before running it |
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 M = {} | |
local module_name = 'map_utils' | |
local fn_store = {} | |
local function register_fn(fn) | |
table.insert(fn_store, fn) | |
return #fn_store | |
end | |
function M.apply_function(id) |
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
let s:packpath = expand('~/.local/share/nvim/site/pack/minpac') | |
let s:hash_dir = expand('~/.local/share/nvim/site/pack/minpac/hashes') | |
let s:pattern = '/{opt,start}' | |
function! s:save_hashes() abort | |
let plugin_dirs = glob(s:packpath .. s:pattern, 1, 1) | |
if empty(plugin_dirs) | |
return | |
endif |
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
-- Taken from here: | |
-- https://github.com/neovim/neovim/issues/14116#issuecomment-977555102 | |
function PromptBackspace() | |
-- Have to know the length of the prompt | |
local prompt = 2 | |
local cursor = vim.api.nvim_win_get_cursor(0) | |
local line = cursor[1] | |
local col = cursor[2] | |
if col ~= prompt then |
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
--[[ | |
Dependencies: | |
Completion: | |
https://github.com/hrsh7th/nvim-cmp | |
https://github.com/hrsh7th/cmp-buffer | |
https://github.com/hrsh7th/cmp-path | |
https://github.com/saadparwaiz1/cmp_luasnip | |
Snippets: |
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 node | |
const os = require('os'); | |
const getNetworkAddress = (interfaces) => { | |
for (const name of Object.keys(interfaces)) { | |
for (const interface of interfaces[name]) { | |
const {address, family, internal} = interface; | |
if (family === 'IPv4' && !internal) { | |
return address; |
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
{ | |
"cache": false, | |
"await": true | |
} |
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
" ============================================================================ " | |
" === EDITING OPTIONS === " | |
" ============================================================================ " | |
" Don't include vi compatibility | |
set nocompatible | |
" Sensible backspace | |
set backspace=indent,eol,start |
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
// Getting some stats from https://dev.to/dashboard | |
// Inspired by this: https://dev.to/tylerlwsmith/get-your-dev-2020-year-in-review-scraping-data-using-the-console-3gen | |
function compose(...fns) { | |
const apply = (arg, fn) => fn(arg); | |
return (initial) => fns.reduceRight(apply, initial); | |
} | |
function to_transducer(reducer) { | |
if(typeof reducer['@@transducer/step'] == 'function') { |