Skip to content

Instantly share code, notes, and snippets.

View suhaibshahid007's full-sized avatar

suhaibshahid007 suhaibshahid007

  • Brooksdale
  • Lahore , Pakistan
View GitHub Profile
@suhaibshahid007
suhaibshahid007 / gist:4558877bb01332bfbf9b9c4ffa2fcd49
Created February 17, 2023 08:28
Deploy Rails App to Digital Ocean server using dokku
Create a project on Digital Ocean.
Create a new droplet using ubuntu(20.04 LTS), select server regiond, other specs, add your public SSH key and take the IP address.
Then ssh into VPS using command - ssh root@<ip-address>
Then install dokku there by using the command - wget https://raw.githubusercontent.com/dokku/dokku/v0.28.4/bootstrap.sh;
sudo DOKKU_TAG=v0.28.4 bash bootstrap.sh . For more Info can follow this link (https://pawelurbanek.com/rails-heroku-dokku-migration)
Then Specify your app name using command - dokku apps:create my-rails-app
Add dokku plugins for rails app to install postgresql/redis (sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git sudo dokku plugin:install https://github.com/dokku/dokku-redis.git redis)
Need to configure public SSH keys to accept by dokku remote. (echo 'YOUR_PUB_KEY' | dokku ssh-keys:add admin)
After that, need to add dokku remote just like we usually do for heroku by using this
@suhaibshahid007
suhaibshahid007 / Ruby on Rails Interview Cheat Sheet.md
Created July 27, 2022 09:48
Ruby on Rails Interview Cheat Sheet

Ruby on Rails Interview Questions

Ruby

  • What is a class?
  • What is an object?
  • What is a module? Can you tell me the difference between classes and modules?
  • Can you tell me the three levels of method access control for classes and modules? What do they imply about the method?
  • There are three ways to invoke a method in ruby. Can you give me at least two?
  • Explain this ruby idiom: a ||= b
  • What does self mean?
  • What is the difference between lambda, block and proc?