Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 17, 2024 15:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@cowboy
cowboy / sudo-keepalive-example.sh
Created July 15, 2012 20:55
Bash: Sudo keep-alive (good for long-running scripts that need sudo internally but shouldn't be run with sudo)
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {
@jwerle
jwerle / cpu-stream.sh
Last active September 11, 2019 10:47
Stream CPU usage with `umq(1)' to a `histo(1)' histogram. See `umq(1)': https://github.com/jwerle/umq See `histo(1)': https://github.com/visionmedia/histo
#!/bin/bash
# ps -eo pcpu,pid,user,args | sort -r -k1
PS="ps"
VERSION="0.0.1"
version () {
echo $VERSION
}
@pascalpoitras
pascalpoitras / config.md
Last active July 9, 2024 09:08
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@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}" $*
@disusered
disusered / profiler
Created July 13, 2015 05:06
Profiling Neovim startup
#!/bin/bash
iterations=10
# -----------------------------------------------------------------------------
# Create array of results
declare -a results
for i in $(seq 1 $iterations);
@mpicker0
mpicker0 / .bashrc
Last active March 2, 2022 20:34
Configuring IntelliJ's terminal to run Cygwin
# Add to your .bashrc so the terminal starts in the project directory
if [[ ${INTELLIJ} == "true" ]]; then
cd ${OLDPWD}
fi
# Note that this works in IntelliJ 14, but not in 16.
# Change the shell path in IntelliJ's Tools > Terminal to:
# C:\cygwin64\bin\env INTELLIJ=true TERM=cygwin C:\cygwin64\bin\bash.exe --login -i
@lukas-h
lukas-h / license-badges.md
Last active July 11, 2024 07:00
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@tanyuan
tanyuan / smart-caps-lock.md
Last active July 14, 2024 15:36
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.
@subfuzion
subfuzion / README.md
Last active May 11, 2024 17:03
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,