Skip to content

Instantly share code, notes, and snippets.

# Credits to for inspiration
function setTabname {
echo -ne "\033]0;"$*"\007"
# set the title using above declared function and set the color of
suhlig / install-tmux
Last active Apr 13, 2021 — forked from philipsd6/install-tmux
Install tmux on rhel/centos
View install-tmux
# Install tmux on rhel/centos 7
# What do we want?
# install deps
yum install gcc kernel-devel make ncurses-devel
rhukster /
Last active Apr 14, 2021
Easy Brew PHP version switching
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
sgtoj /
Last active Apr 18, 2021
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
cheungnj /
Last active Apr 6, 2021
Convert asciidoc to Github Flavored Markdown
# Adapted from
# Using asciidoctor and pandoc
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget
$ sudo dpkg -i pandoc-
# Convert asciidoc to docbook using asciidoctor
bdpwebdesign /
Last active Apr 15, 2021
Apple Magic Keyboard mapping for Linux Mint

Map an Apple Magic Keyboard to a Linux machine

Configured for a Mac-like experience

Apple Magic Keyboard 2: Model A1644 (same as MLA22LL/A ?)

Mapping for Linux Mint 18 Cinnamon 64-bit

xmodmap source

noelboss /
Last active Apr 18, 2021
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like or and pull or export it to a production server. Or you use a service like to act upon a Web-Hook that's triggered that service.

miroslavtamas /
Created Apr 22, 2016
Install Apache Maven 3.3.9 on CentOS
tar xzf apache-maven-3.3.9-bin.tar.gz
mkdir /usr/local/maven
mv apache-maven-3.3.9/ /usr/local/maven/
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
alternatives --config mvn
domenic / angularpromise.js
Created Jan 21, 2016
How to subclass a promise
View angularpromise.js
// ES6
class AngularPromise extends Promise {
constructor(executor) {
super((resolve, reject) => {
// before
return executor(resolve, reject);
// after
squarism /
Last active Apr 14, 2021
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)