Skip to content

Instantly share code, notes, and snippets.

View masroorhussainv's full-sized avatar
🏴

Masroor Hussain masroorhussainv

🏴
View GitHub Profile
@masroorhussainv
masroorhussainv / ruby-exponential-backoff.rb
Created February 21, 2022 11:04
Exponential Backoff Retrying Algorithm in Ruby [modified] - Polished Ruby Programming by Jeremy Evans
require 'net/http'
require 'uri'
uri = URI("http://example.local/file")
retries = 0
begin
Net::HTTP.get_response(uri)
rescue SocketError, SystemCallError, Net::HTTPBadResponse
retries += 1
@masroorhussainv
masroorhussainv / cli-aliases.bat
Last active May 12, 2022 14:35
Terminal Aliases
# Git aliases
alias gg="git"
alias ss="git status"
alias gf="git fetch"
alias gfo="git fetch origin"
alias gb="git branch"
alias gad="git add"
alias gada="git add ."
alias gs="git status"
alias df="git diff"

Services

MAC OS

Redis

  • install
brew update
brew install redis

Git commands

Set up Name and Email

git config user.email 'email@example.com'
git config user.name 'Masroor Hussain'

Create a repo

@masroorhussainv
masroorhussainv / heroku_pg_db_reset.md
Last active May 12, 2022 14:36 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart -a app_name
  • Step 2: heroku pg:reset DATABASE -a app_name (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate -a app_name
  • Step 4: heroku run rake db:seed -a app_name (if you have seed)

One liner

heroku restart -a app_name; heroku pg:reset DATABASE -a app_name --confirm APP-NAME; heroku run rake db:migrate -a app_name