Skip to content

Instantly share code, notes, and snippets.

View engeir's full-sized avatar
🚗

Eirik Rolland Enger engeir

🚗
View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@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.
@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}" $*
@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
@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
@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
@parmentf
parmentf / GitCommitEmoji.md
Last active July 23, 2024 11:27
Git Commit message Emoji
@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.
@nicolasdao
nicolasdao / open_source_licenses.md
Last active July 21, 2024 20:51
What you need to know to choose an open source license.
@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}