Skip to content

Instantly share code, notes, and snippets.

View marciojg's full-sized avatar

Marcio de Jesus marciojg

View GitHub Profile
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
@marciojg
marciojg / mysql.database.yml
Created January 18, 2020 14:22 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@marciojg
marciojg / rspec_model_testing_template.rb
Created January 19, 2020 13:36 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@marciojg
marciojg / rspec_helper_example.md
Created January 19, 2020 21:43 — forked from HeroicEric/rspec_helper_example.md
An example of how to create a RSpec test helper

RSpec Helper Example

Here's an example of a rspec test helper that will let you sign in as a given user.

Create spec/support/helpers/authentication.rb with the following:

module Helpers
  module Authentication
    def sign_in_as(user)
@marciojg
marciojg / webpacker_rails.md
Created January 18, 2020 14:44 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
rails c
require 'sidekiq/api'
puts 'remove sheduled - start'
ss = Sidekiq::ScheduledSet.new
ss.select {|scheduled| scheduled['queue'] == 'nome_da_fila' }.map(&:delete)
puts 'remove sheduled - finished'
puts 'remove retry nome_da_fila - start'
# frozen_string_literal: true
class AutomaticBenefit < ApplicationRecord
include Activatable
attr_accessor :unit_id, :program_id, :teste
default_value_for :teste, value: false, allows_nil: false
belongs_to :material_resource
version: '3'
services:
mysqlsrv:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "root"
ports:
- "3306:3306"