Skip to content

Instantly share code, notes, and snippets.

@echasnovski
echasnovski / neovim-survey-summary_00_description.md
Last active May 22, 2023 17:28
Results of Neovim built-in options survey

This Gist contains results of Neovim built-in options survey. Users were asked to execute certain script (see 'neovim-survey_script.lua') and upload text it produced (comma-separated table of all options which differ from default, plus neovim version and leader key).

There were total 227 legible answers provided for period from 2022-11-22 to 2022-12-08.

Here is a link to Reddit announcement

File description:

@dstar4138
dstar4138 / note.sh
Last active December 14, 2021 14:58
My note/journal manager, similar to memo but only in bash.
#!/usr/bin/env bash
# My simple note/journal manager. Needs fzf/vim by default.
set -aeuf -o pipefail
VERSION="0.5"
USAGE="Usage: note COMMAND
Note is a simple bash script for note creation/management. It can be extended
with plug-ins, or used as is. It creates notes in NOTE_BASE (~/.notes), and
keeps an append-only daily journal that you can add quick-notes to.
@brlodi
brlodi / base16_ansi.vim
Created March 12, 2020 21:39
A pure-ANSI colorscheme for VIM, designed to leverage the excellent Base16 colors you've already defined for your terminal. No more mismatched Vim and terminal colors!
" A pure-ANSI colorscheme for VIM, designed to leverage the excellent Base16
" colors you've already defined for your terminal emulator or via base16-shell.
" No more mismatched Vim and terminal colors!
"
" Author: Benjamin Lodi <brlodi@gmail.com>
"
" WARNING: This *will* look terrible without Base16 terminal colors, which map
" various shades of grey to many of the bright color points.
" WARNING: iTerm 2 users, make sure you're using a base16-*.dark.itermcolors
" file, even if you have a light theme.
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@android10
android10 / vpn.sh
Created August 20, 2018 15:19
LINUX: Script to facilitate running openvpn from the command line, especially when a Linux/Unix client is used with Access Server, the Access Server is unable to alter the DNS settings on the client in question causing issues on host resolving.
# -----------------------------------------------
# BEFORE USING THIS SCRIPT
# -----------------------------------------------
# 1 - Create a file in /etc/<yourpassfile>.pass which contains the vpn private key password.
# 2 - Set permission for the file: 'sudo chmod 600 /etc/<yourpassfile>.pass' - Owner can read and write.
# 3 - Create an alias in your .bashrc or bash_profile: alias vpn="sudo sh <path to your script>".
# 4 - Set the value of the variable OVPN_FILE_PATH with the path of the .ovpn file.
# 5 - Set the value of the variable OVPN_PRIVATE_KEY_FILE_PATH with the path of the created file in step #1: /etc/<yourpassfile>.pass
# 6 - OPTIONAL: avoid password when executing the script, add this to /etc/sudoers '<your username> ALL=(ALL:ALL) NOPASSWD:<path to your script>'
@bobpaul
bobpaul / gnu_getopt_example.sh
Created March 20, 2018 18:24
An example showing how to use getopt
#!/usr/bin/env bash
# Time-stamp: <2017-04-27 09:57:21 kmodi>
# Time-stamp: <2018-03-20 12:58:02 bobpaul>
# derived from kmodi's gist: https://gist.github.com/kaushalmodi/74e9875d5ab0a2bc1010447f1bee5d0a
#
# Example of using getopt to parse command line options
# http://stackoverflow.com/a/29754866/1219634 Limitation: All the options
# starting with - have to be listed in --options/--longoptions, else getopt will
# error out.
# The downside is that if you intend to use this as a wrapper to some other program,
@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@romainl
romainl / vanilla-linter.md
Last active April 13, 2024 03:30
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate