I hereby claim:
- I am sebasjimenez10 on github.
- I am sebasjimenez10 (https://keybase.io/sebasjimenez10) on keybase.
- I have a public key ASBL1oCpdd9w-zYFCnCNZkldkHNttuZ06f2tXetRYelUMgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I've been working on a small rails application and I've been wondering about the best way to have a development environment almost as identical as the production environment this app would run on. There are a few ways that I've seen around this, like normalizing environments by vendoring all the gems, setting ruby version files, versioning every gem you use in the Gemfile (which is a VERY recommended practice by the way). But all of this revolves around the rails project itself. We should also keep in mind all the things that affect our project, like the db version we use, if we use redis, or any other external service.
This is why I decided to give a try to docker, since in my experience I've always installed and bundled my apps directly on my machine.
Here are some of the things I learned in the process.
// SublimeLinter Settings - User | |
{ | |
"linters": { | |
"rubocop": { | |
"enable": false, | |
"executable": "/Users/sebastian/.rbenv/shims/ruby", | |
"args": ["--config", "./.rubocop.yml"], | |
"use_bundle_exec": true | |
}, | |
"ruby": { |
# frozen_string_literal: true | |
# ArrayFlattener provides a method called `flatten_array` which returns a flat array | |
# from an array of nested arrays. | |
class ArrayFlattener | |
# The method uses a local variable | |
# as a memory object and passes it | |
# to the recursive method `recursive_flatten` | |
def flatten_array(arr) | |
result = [] | |
recursive_flatten(arr, result) |
gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include | |
# Building native extensions with: '--with-cppflags=-I/usr/local/opt/openssl/include' | |
# This could take a while... | |
# Successfully installed eventmachine-1.0.8 | |
# 1 gem installed | |
# You can also set up bundler like this but I think that is superficial | |
bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include | |
# And then run |
sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
sudo /usr/local/mysql/bin/mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSOWORD';
\q