Skip to content

Instantly share code, notes, and snippets.

View marciojg's full-sized avatar

Marcio de Jesus marciojg

View GitHub Profile
version: '3'
services:
mysqlsrv:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "root"
ports:
- "3306:3306"
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'
{"version":1,"resource":"file:///home/marcio/projects/pier/pier-quotes/app/interactions/admin/judicial_claim/loss_forecast/process.rb","entries":[{"id":"olNh.rb","timestamp":1676660147536},{"id":"WfFS.rb","timestamp":1676660176220},{"id":"HZcY.rb","source":"moved.source","timestamp":1676660203843},{"id":"sago.rb","timestamp":1676660209970},{"id":"12ZH.rb","timestamp":1676660335544},{"id":"wRH8.rb","timestamp":1676660417101},{"id":"GRor.rb","timestamp":1676660473725},{"id":"Q6zH.rb","timestamp":1676660971955},{"id":"ceGi.rb","timestamp":1676661027092},{"id":"5RlZ.rb","timestamp":1676661150689},{"id":"SJlX.rb","timestamp":1676661755776},{"id":"pIhQ.rb","timestamp":1676661825453},{"id":"4ULD.rb","timestamp":1676661835763},{"id":"JzZZ.rb","source":"undoRedo.source","timestamp":1676661846409},{"id":"LkmQ.rb","timestamp":1676662000840},{"id":"ljOT.rb","source":"undoRedo.source","timestamp":1676662047021},{"id":"uSSj.rb","timestamp":1676663546808},{"id":"2s47.rb","timestamp":1676663744709},{"id":"5484.rb","source":"
@marciojg
marciojg / Guia rápido de instalação do WSL2 + Docker.md
Last active September 6, 2024 19:56 — forked from argentinaluiz/Guia rápido de instalação do WSL2 + Docker.md
Startup DEV WINDOWS/LINUX - Guia rápido de instalação do WSL2 + Docker

Startup DEV WINDOWS/LINUX - Guia rápido de instalação do WSL2 + Docker

INSTRUCÃO OFICIAL: https://docs.microsoft.com/pt-br/windows/wsl/install-win10

Em 2016, a Microsoft anunciou a possibilidade de rodar o Linux dentro do Windows 10 como um subsistema e o nome a isto foi dado de WSL ou Windows Subsystem for Linux.

O acesso ao sistema de arquivos no Windows 10 pelo Linux era simples e rápido, porém não tinhamos uma execução completa do kernel do Linux e outros artefatos nativos e isto impossibilitava a execução de várias tarefas no Linux, uma delas é o Docker.

Em 2019, a Microsoft anunciou o WSL2, com uma dinâmica aprimorada em relação a 1ª versão:

@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 / 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 / webpacker_rails.md
Created January 18, 2020 14:44 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@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:
# 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