Skip to content

Instantly share code, notes, and snippets.

View johncorderox's full-sized avatar
:shipit:
SHIP IT!!!!

John Cordero johncorderox

:shipit:
SHIP IT!!!!
View GitHub Profile
@johncorderox
johncorderox / webpacker.rb
Last active October 29, 2021 07:11
rails skip webpacker
# Install PG skip tests skip webpacker install
rails new app_name -T --database=postgresql --skip-webpack-install
@johncorderox
johncorderox / .js
Last active April 30, 2021 16:42
React Delete + Axios
// After an API call to delete, refresh the state with Filter.
var NewThings = this.state.things.filter((x) => { return x.id != id;});
@johncorderox
johncorderox / chruby.sh
Last active November 22, 2021 19:40
ch-ruby.sh
# ch-ruby alt besides rbenv
cd ~/src && wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz && tar -xzvf chruby-0.3.9.tar.gz && cd chruby-0.3.9/ && sudo make install && ruby-install ruby 2.6.4
@johncorderox
johncorderox / model.rb
Last active April 29, 2021 23:51
RSpec with Shoulda Matchers
# Reduce the load of MODEL_NAME.rb with shoulda_matchers
context "Associations" do
%w(users books authors comments topics emails stories tasks reminders notes todos computers games homes pages).each do |attr|
it { should have_many(attr) }
end
end
@johncorderox
johncorderox / install.sh
Last active August 4, 2021 04:24
Download Ruby on Ubuntu
# Ruby 2.6.4
sudo apt update && sudo apt -y upgrade && sudo apt -y install build-essential libpq-dev git memcached cifs-utils nginx redis-server nodejs imagemagick libtiff-dev ghostscript
sudo apt-get install graphicsmagick-imagemagick-compat
## Machine
sudo apt-get install git
# ruby-install https://github.com/postmodern/ruby-install
mkdir -p ~/src