Skip to content

Instantly share code, notes, and snippets.

View snowch's full-sized avatar

Chris Snow snowch

View GitHub Profile
@snowch
snowch / .inputrc
Created June 22, 2020 14:01 — forked from johnlim/.inputrc
Set bash to use Vi-mode and remap <Esc> to jj
# want vi to be the default editor for readline
set editing-mode vi
# vi settings
$if mode=vi
# normal mode
set keymap vi-command
# insert mode
set keymap vi-insert
"jj": vi-movement-mode # remap escape
@johnlim
johnlim / .inputrc
Last active April 3, 2021 08:14
Set bash to use Vi-mode and remap <Esc> to jj
# want vi to be the default editor for readline
set editing-mode vi
# vi settings
$if mode=vi
# normal mode
set keymap vi-command
# insert mode
set keymap vi-insert
"jj": vi-movement-mode # remap escape
@chilicat
chilicat / scp-ssh.gradle
Last active July 10, 2023 02:53
A simple gradle task to upload a file via SCP to a remote host and to execute a command via SSH on a remote host.
repositories { mavenCentral() }
configurations { sshAntTask }
dependencies { sshAntTask 'org.apache.ant:ant-jsch:1.9.2' }
ant.taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active June 4, 2024 01:52
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: