Skip to content

Instantly share code, notes, and snippets.

View ankibalyan's full-sized avatar

Ankit Balyan ankibalyan

View GitHub Profile
@ankibalyan
ankibalyan / gist:388d7de1f5475d8ed85b367e490c7551
Created October 9, 2017 09:15
Redirects from nginx based on user agent
# APP redirects
if ($http_user_agent ~* "iphone|ipod|ipad|appletv") {
rewrite ^/adl/(.*)$ https://itunes.apple.com/us/app/apple-store/id375380948?mt=8&params=$1 redirect;
}
if ($http_user_agent ~* "android") {
rewrite ^/adl/(.*)$ https://play.google.com/store/apps/details?id=com.app.witpay&params=$1 redirect;
}
if ($http_user_agent ~* "Windows") {
rewrite ^/adl/(.*)$ https://example.com/$1 redirect;
ServerAliveInterval 60
StrictHostKeyChecking no
Host awesome-dev
Hostname xx.xx.xxx.xx
User <username>
IdentityFile ~/.ssh/dev-serverkeyfile.pem
Host awesome-prod
Hostname xx.xx.xxx.xx
User <username>
@ankibalyan
ankibalyan / gist:a202d701505dba2e2ac561b1d4bf2363
Last active December 3, 2018 19:19
My Vim Settings (Basic Version) ~/.vimrc
syntax on
set ai
set number
set mouse+=a
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab " use spaces instead of tabs.
set smarttab " let's tab key insert 'tab stops', and bksp deletes tabs.
set shiftround " tab / shifting moves to closest tabstop.