Skip to content

Instantly share code, notes, and snippets.

View engeir's full-sized avatar
🚗

Eirik Rolland Enger engeir

🚗
View GitHub Profile
@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active July 24, 2024 06:13
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)
@seignovert
seignovert / zenodo-doi-first-badge.md
Created February 21, 2019 20:02
Setup Zenodo DOI badge before the first release

Setup Zenodo DOI badge before the first release

Zenodo doi badge

Before submitting your first release, identify your Github repo id on Github API at:

https://api.github.com/repos/{user}/{repo}
@nicolasdao
nicolasdao / open_source_licenses.md
Last active July 21, 2024 20:51
What you need to know to choose an open source license.
@tanyuan
tanyuan / smart-caps-lock.md
Last active July 22, 2024 23:05
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@parmentf
parmentf / GitCommitEmoji.md
Last active July 23, 2024 11:27
Git Commit message Emoji
@weibeld
weibeld / set_prompt.sh
Created December 10, 2015 10:54
Bash Prompt With Exit Code of Last Command
# Set a Bash prompt that includes the exit code of the last executed command.
#
# Setup: paste the content of this file to ~/.bashrc, or source this file from
# ~/.bashrc (make sure ~/.bashrc is sourced by ~/.bash_profile or ~/.profile)
#
# Daniel Weibel <danielmweibel@gmail.com> October 2015
#------------------------------------------------------------------------------#
# Command that Bash executes just before displaying a prompt
export PROMPT_COMMAND=set_prompt
@hudon
hudon / dockerize-env
Last active April 1, 2023 03:30
Workaround so you can use `docker run --env-file .env` and read variables with newline escape sequences in them
#!/bin/bash
# Docker can't pass newlines to containers if there are \n in variables in
# --env-file files. This tool creates a $1.exported file with newlines that
# can be sourced before running your container and a $1.vars for you to pass
# to --env-files so docker passes those variables to the container.
# Usage:
# dockerize-env .env
# This creates: .env.vars and .env.exported
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active July 22, 2024 07:23
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@vext01
vext01 / vimura.md
Last active February 14, 2024 03:36
Vim+Zathura+Synctex

Vim+Zathura+Synctex

  • In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
@miki725
miki725 / .bash_prompt.sh
Last active June 25, 2024 08:57
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.