Skip to content

Instantly share code, notes, and snippets.

View MINER.md
View template.rb
def migration_ts
sleep(1)
Proc.new { Time.now.strftime("%Y%m%d%H%M%S") }
end
def copy_from_repo(filename, opts={})
repo = "https://raw.githubusercontent.com/matteolc/rails-api-template/master/"
source_filename = filename
destination_filename = filename
destination_filename = destination_filename.gsub(/create/, "#{migration_ts.call}_create") if opts[:migration_ts]
View redis-server.service
[Unit]
Description=Advanced key-value store
After=network.target
Documentation=http://redis.io/documentation, man:redis-server(1)
[Service]
Type=forking
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no
ExecStop=/bin/kill -s TERM $MAINPID
PIDFile=/var/run/redis/redis-server.pid
View Torrents
https://rutracker.org/
https://dytt8.net/
https://www.elitetorrent.biz/
https://www.torrent9.uno/
http://yts.am/
http://1337x.to/
http://thepiratebay.org/
http://rarbg.to/
https://torrentz2.eu/
https://nyaa.si/
@esmerino
esmerino / docker-pry-rails.md
Created Apr 30, 2020 — forked from nvick/docker-pry-rails.md
Using pry-rails with Docker
View docker-pry-rails.md

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

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

@esmerino
esmerino / gist:14fbb88ce984adffdb5763d4ae347f24
Created Apr 3, 2020 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
View gist:14fbb88ce984adffdb5763d4ae347f24
## From Lynda.com 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"
services:
app:
build: .
command: foreman start
volumes:
- .:/app
- ~/.ssh:/root/.ssh:ro
ports:
- "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 \