Skip to content

Instantly share code, notes, and snippets.

View exalted's full-sized avatar
🏠
Working from home

Ali Servet Donmez exalted

🏠
Working from home
View GitHub Profile
@exalted
exalted / create-git-repo-from-subdirectory.sh
Last active July 9, 2018 02:02
Given a subdirectory extract separate repo out of an existing one
# Simple
git filter-branch --prune-empty --subdirectory-filter foobar/ --tag-name-filter cat -- --all
# Complex
# (Ref.: http://stackoverflow.com/a/17867910/11895,
# http://stackoverflow.com/a/19957874/11895)
git filter-branch -f --prune-empty --index-filter \
'git rm --cached --ignore-unmatch -r -q -- . ; \
git reset -q $GIT_COMMIT -- .gitignore README.md foo/ bar/' \
-- --all
@exalted
exalted / sql-cheatsheet.txt
Last active July 9, 2018 02:02
SQL Cheatsheet
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
| [INNER] JOIN B ON A."FOO" = B."BAR" [AND ...]; |
| |
+--------------------------------------------------------------------+
| |
| SELECT * |
| FROM A |
@exalted
exalted / healthcheck.sh
Last active February 18, 2021 09:05
healthcheck.sh
#
# USAGE: `healthcheck <name> <URL>`
#
# Minify using http://bash-minifier.appspot.com
healthcheck() {
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
COLOR_RESET='\033[0m'
@exalted
exalted / create-ssh-key.md
Last active December 2, 2022 08:37
Create SSH key (Heroku)

Create SSH key

It's best having separate keys on different workstations (e.g., home, office, etc.).

Generate a public key:

ssh-keygen -t rsa -f ~/.ssh/heroku_rsa -C"$(whoami)@$(hostname)"`