Skip to content

Instantly share code, notes, and snippets.

@choyno
choyno / gist:e6d703ed48b96d81a07ba19da00e1ef0
Last active May 7, 2019 07:49
MOUNTING S3 to your Application Uploads Folder using GOOFYS
$ sudo su -
# sudo yum install golang fuse -y
# export GOPATH=/usr/local/go
# go env GOPATH
/usr/local/go
# go get github.com/kahing/goofys
# go install github.com/kahing/goofys
@choyno
choyno / nginxsetup.txt
Last active August 16, 2024 18:49
RESTART NGINX AMAZON LINUX AMI
Try to run the following two commands:
sudo fuser -k 80/tcp
sudo fuser -k 443/tcp
NGINX BASIC COMMAND
sudo service nginx restart
sudo service nginx start
sudo service nginx stop
@choyno
choyno / UTF-8 ERROR CANNOT PASTE JAPANESE KOREAN CHARACTER
Last active April 25, 2019 03:37
UTF-8 ERROR CANNOT PASTE JAPANESE/KOREAN CHARACTER
```https://stackoverflow.com/questions/19857471/how-to-input-unicode-character-in-rails-console```
LANGUAGE="en_US.UTF-8"
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
ERROR
rb:65:in `register'
1: from /Users/ariel/.rvm/gems/ruby-2.5.1@san-in/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/Users/ariel/.rvm/gems/ruby-2.5.1@san-in/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': dlopen(/Users/ariel/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
Referenced from: /Users/ariel/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
Reason: image not found - /Users/ariel/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
Uninstall Postgres GUIDE
https://medium.com/@bitadj/completely-uninstall-and-reinstall-psql-on-osx-551390904b86
Swtiching Postgres Version GUIDE
https://apple.stackexchange.com/questions/304024/how-do-you-install-an-older-version-of-postgres-9-6-using-homebrew
Dropping PUBLIC Schema
https://stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql
@choyno
choyno / install-yarn.md
Created December 1, 2018 15:31 — forked from mikerourke/install-yarn.md
Upgrades/Installation in Cloud9

Installing Yarn in Cloud9

You can't just follow the directions on the site, you have to do some mojo first.

Step 1. Run update.

sudo apt-get update

Step 2. Install apt-transport-https.

@choyno
choyno / rspec_model_testing_template.rb
Created November 12, 2018 08:51 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
https://nandovieira.com/using-postgresql-and-jsonb-with-ruby-on-rails
Using PostgreSQL and jsonb with Ruby on Rails
February 17, 2015
Read in 8 minutes
PostgreSQL 9.4 introduced jsonb, a new column type for storing documents in your relational database. jsonb and json columns look exactly the same on a higher level, but differs on the storage implementation.
The advantage of using jsonb is that you can easily integrate relational and non-relation data, with performance that can be better than most non-relational databases like MongoDB.
Enable VirtualHosts and Proxy in Apache config
Edit /private/etc/apache2/httpd.conf in your text editor. Uncomment the following lines (remove the "#")
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
Include /private/etc/apache2/extra/httpd-vhosts.conf
Create VirtualHosts for your site
@choyno
choyno / gist:cc676746aa8b9b066b2034026c56c535
Created October 23, 2018 03:38
Fetch and create other Branch
git branch -r
origin/HEAD -> origin/master
origin/daves_branch
origin/discover
origin/master
git fetch origin discover
git checkout discover