Skip to content

Instantly share code, notes, and snippets.

View salmanx's full-sized avatar

Salman Mahmud salmanx

  • Dhaka, Bangladesh
View GitHub Profile
@salmanx
salmanx / postgres-cheatsheet.md
Created May 2, 2017 12:23 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@salmanx
salmanx / docker-help.md
Created March 31, 2019 08:37 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@salmanx
salmanx / .eslintrc.js
Created October 25, 2019 06:01 — forked from adrianhall/.eslintrc.js
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@salmanx
salmanx / running_app_in_production_locally.markdown
Created December 19, 2019 03:45 — forked from rwarbelow/running_app_in_production_locally.markdown
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@salmanx
salmanx / eslint_prettier_airbnb.md
Created December 20, 2019 16:01 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
$ passwd
@salmanx
salmanx / readme.md
Created August 1, 2021 14:21 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App