Skip to content

Instantly share code, notes, and snippets.

View template.rb
def migration_ts
sleep(1) {"%Y%m%d%H%M%S") }
def copy_from_repo(filename, opts={})
repo = ""
source_filename = filename
destination_filename = filename
destination_filename = destination_filename.gsub(/create/, "#{}_create") if opts[:migration_ts]
View redis-server.service
Description=Advanced key-value store
Documentation=, man:redis-server(1)
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no
ExecStop=/bin/kill -s TERM $MAINPID
View Torrents
esmerino /
Created Apr 30, 2020 — forked from nvick/
Using pry-rails with Docker

First, add pry-rails to your Gemfile:

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

esmerino / gist:14fbb88ce984adffdb5763d4ae347f24
Created Apr 3, 2020 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from course 'RSpec Testing Framework with Ruby'
View gist:14fbb88ce984adffdb5763d4ae347f24
## From course 'RSpec Testing Framework with Ruby'
describe 'Expectation Matchers' do
describe 'equivalence matchers' do
it 'will match loose equality with #eq' do
a = "2 cats"
b = "2 cats"
expect(a).to eq(b)
View Banckup and Restore dabases
docker-compose exec -T postgres pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d enlistment_development < ../../latest.dump
docker-compose exec -T postgres psql -h localhost -U postgres -d app_vipbeneficios_development < ../databases/database1901201229.sql
View Clean Dockers
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -a -q)
docker volume rm $(docker volume ls -q)
docker network rm $(docker network ls | tail -n+2 | awk '{if($2 !~ /bridge|none|host/){ print $1 }}')
View docker-compose.yml
version: "3"
build: .
command: foreman start
- .:/app
- ~/.ssh:/root/.ssh:ro
- "3000:3000"
View Dockerfile
FROM ruby:2.6.4-alpine
RUN apk add --no-cache --update build-base \
linux-headers \
libxml2-dev \
libxslt-dev \
postgresql-dev \
tzdata \
nodejs \
yarn \
ghostscript \