Skip to content

Instantly share code, notes, and snippets.

@pabloasanchez
pabloasanchez / nvim_open_win
Last active December 31, 2023 04:41
Neovim: Open buffer in a floating window
:lua vim.api.nvim_open_win(0, true, {relative='win', width=200, height=200, row=16, col=16})
@pabloasanchez
pabloasanchez / fish2bash
Last active October 13, 2023 19:44
Taking a few things from my fish cfg back to bash
# Taking a few things from my fish cfg back to bash: vi keys, branch name in prompt, custom prompt, completion (with fzf)
# Custom prompt
# Vi keys
# History
# Completion (Using fzf & fzf-tab-completion)
# Tip: Install bashmarks and fasd for faster directory browsing
# Custom prompt: Add to .bashrc
# Helps reset prompt when tty crashes
@pabloasanchez
pabloasanchez / to-netscape-bookmarks.sh
Created July 27, 2023 18:35
Generate a Netscape format Bookmarks.html from a file with a list of URLs
#!/usr/bin/env node
/*
Usage: ./to-netscape-bookmarks.sh urls | tee bookmarks.html
urls is a simple textfile with urls separated by breakline
Titles are pulled with pup tool
*/
const { exec } = require('child_process'), fs = require('fs'), readline = require('readline')
const file = process.argv[2]
@pabloasanchez
pabloasanchez / copy_layers.py
Created May 22, 2023 09:33
A simple GIMP plugin for copying layers.
#!/usr/bin/env python
# A simple plugin for copying layers.
# The layers can be copied in normal or reverse order,
# and can be placed at the top or bottom of the destination's layers,
# or above the selected layer in the destination.
from gimpfu import *
def copy_layers(origin, dest, order, position):
@pabloasanchez
pabloasanchez / gimp-script.py
Created May 22, 2023 08:24
GIMP Python plug-in template from gimpbook.com with additional notes
#!/usr/bin/env python
# GIMP Python plug-in template.
# To run the plugin, place it in .config/GIMP/plug-ins/PLUG_DIR/PLUG_NAME.py
# Where PLUG_DIR and PLUG_NAME are the name of your script e.g. myscript/myscript.py
# Note for AppImage version replace GIMP with GIMP-AppImage
# make the script executable (chmod +x myscript.py)
from gimpfu import *
@pabloasanchez
pabloasanchez / CycleReplace.vim
Last active March 1, 2021 17:07
Vimscript for replacing word under cursor from a provided list
" Call the function with the cursor under a word in normal mode.
" The word will be replaced with the next word of a provided list.
"
" For example, passing a list like this ['true', 'false', 'undefined', 'null']...
"
" // Example code
" let myBool = true
"
" ...and pressing CTRL+L over the word "true" will replace it with the next word on the list: That is, "false".
"
@pabloasanchez
pabloasanchez / Tab Context.sublime-menu
Last active December 21, 2020 23:20
Sublime Text 3 Plugin: Close all saved tabs
[
{ "caption": "-" },
{ "command": "close_saved", "caption": "Close Saved Files" }
]