Docker postgres command:
docker run --rm --name my-postgres -p 5432:5432 -v [full dir path]/postgres.bk:/var/lib/postgresql/data postgres
--rm
: remove an existing instances
-p
bind the port to the host machine
Docker postgres command:
docker run --rm --name my-postgres -p 5432:5432 -v [full dir path]/postgres.bk:/var/lib/postgresql/data postgres
--rm
: remove an existing instances
-p
bind the port to the host machine
/sbin/ip route|awk '/default/ { print $3 }' |
reloader:
server = TCPServer.new 2222
puts 'loading hot reloader...'
Thread.new do
puts 'firing up a thread....'
loop do
Thread.start(server.accept) do |client|
file = client.gets.chomp.gsub('/Users/dan/promptworks/colonial-surety/', '')
fire up the console in the test env:
RAILS_ENV=test script/console
then require a Ruby test runner:
require 'test/unit/ui/console/testrunner'
require 'csv' | |
require 'erb' | |
class Address | |
def initialize(row) | |
@row = row | |
end | |
def name | |
text(@row[0]) |
zcat -f logs/access.log* | goaccess --log-format=COMBINED --ignore-crawlers -a -o report.html |
Some quick notes about using Rails 5.1 webpacker gem for React integration and react_ujs
to premount components.
For reference, react_ujs
is the JS library from react-rails that renders React components with props. It expects a parent with data-react-class
and data-react-props
set.
I don't remember my initial setup, but probably:
bundle exec rails new . --webpack=react --force
yarn add react_ujs
export $(cat file.env | xargs) && [command] |