Skip to content

Instantly share code, notes, and snippets.

View htq287's full-sized avatar
🤙
Feel Comfortable

Hung Q. htq287

🤙
Feel Comfortable
View GitHub Profile
@htq287
htq287 / mac-setup-redis.md
Created October 21, 2020 04:41 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@htq287
htq287 / rm_mysql.md
Created August 26, 2020 14:32 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@htq287
htq287 / rename.swift
Created August 29, 2019 09:59
Script to rename files and replace text, contained in a folder
#!/usr/bin/env xcrun swift
import Foundation
let currentText = ""
var newText = ""
let fileManager = FileManager.default
@htq287
htq287 / setup_nginx_with_ror_on_mac.md
Created August 22, 2019 10:37 — forked from vikashvikram/setup_nginx_with_ror_on_mac.md
How to setup nginx and passenger for a ruby on rails application on Mac OS X

Setting up nginx with passenger for a Ruby on Rails app on Mac OSX

Nginx with passenger is a very popular choice for production and staging environment for rails applications. It is always a good practice to replicate the production and staging environments on our local systems so that we do not have last minute surprises while deploying. Most of the Ruby on Rails developers use Mac OS as their development environment so this document is regarding setting up Nginx with on it for an already existing rails app. The assumption for this doc is that you do not even have ruby installed on your system. So feel free to skip the steps that are not relevant.

Installing Ruby, setting up Rails app, installing gems and nginx

The recommended way to work on a rails app is to use rvm for installing ruby. We need to have multiple versions of ruby and our gems