Skip to content

Instantly share code, notes, and snippets.

gbero / fish_shell_android_home.txt
Last active March 24, 2023 08:00
Export $ANDROID_HOME on MacOS with Fish shell
View fish_shell_android_home.txt
touch ~/.config/fish/;
echo "set --export ANDROID $HOME/Library/Android;" >> ~/.config/fish/
echo "set --export ANDROID_HOME $ANDROID/sdk;" >> ~/.config/fish/
echo "set -gx PATH $ANDROID_HOME/tools $PATH;" >> ~/.config/fish/
echo "set -gx PATH $ANDROID_HOME/tools/bin $PATH;" >> ~/.config/fish/
echo "set -gx PATH $ANDROID_HOME/platform-tools $PATH;" >> ~/.config/fish/
echo "set -gx PATH $ANDROID_HOME/emulator $PATH" >> ~/.config/fish/
echo "set --export JAVA_HOME /Applications/Android\;" >> ~/.config/fish/
roadrunner2 / 0
Last active May 28, 2023 07:55
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)
View 0


This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

michaelkeevildown /
Last active June 2, 2023 15:07
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
View gist:e89ed4a882eb629b0a70040f876479c6
function fish_mode_prompt --description 'Displays the current mode'
# Do nothing if not in vi mode
if test "$fish_key_bindings" = "fish_vi_key_bindings"
switch $fish_bind_mode
case default
set_color --bold red
echo 🅽
case insert
set_color --bold green
echo 🅸
likethesky / elixirphoenix.bash
Last active January 5, 2022 10:00
Installing Elixir & the Phoenix framework with Homebrew on OS X
View elixirphoenix.bash
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install
P7h /
Last active July 21, 2021 15:38
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
View github-to-bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
m3nd3s / NERDTree.mkd
Last active February 24, 2023 15:31
My Vim Cheat Sheet
View NERDTree.mkd


o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

andreyvit /
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream