Skip to content

Instantly share code, notes, and snippets.

View henrymazza's full-sized avatar

Fabio Mazarotto henrymazza

View GitHub Profile

Table of Contents

# Table of Contents
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />

Payload for ML

PS: all data was anonymized

ClientReferralMember

File: sonder-rails/app/models/client_referral_member.rb

  • this holds the match pair
  • is a Join Table that holds (but not limited to) these associations:
    • client_referral
    • persona_client

Payload for ML

ClientReferral

  [6] pry(main)> ClientReferral.last(100).first

  ClientReferral Load (17.8ms)  SELECT "client_referrals".* FROM "client_referrals" ORDER BY "client_referrals"."id" DESC LIMIT $1  [["LIMIT", 100]]

#<ClientReferral:0x000000011dbb1250> {

sodner-rails on M1 macOS

# frozen_string_literal: true
require 'hello'
RSpec.describe Hello do
describe '.world' do
subject(:world) do
described_class.world
end
# frozen_string_literal: true
class Hello
def self.world
'helloworld'
end
def self.rand_list(length, lowerb, upperb)
0.upto(length - 1).map do
rand(lowerb..upperb)
version: '3.9'
services:
sidekiq:
depends_on: [ redis, db, bg_sync ]
image: nemo:x86
platform: linux/amd64
web:
depends_on: [ redis, db, bg_sync ]
@henrymazza
henrymazza / docker-exec-all
Last active March 28, 2021 04:08 — forked from timhodson/runCommandAllDockers.sh
Run a command on all docker containers
#!/bin/sh
if [ $# -eq 0 ]; then
echo "No arguments provided"
exit 1
fi
for container in `docker ps -q`; do
# show the name of the container
printf '%-40s' $(docker inspect --format='{{.Name}}' $container)
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'FeedsController with Capybara', type: :feature do
before do
# control group
create_list :auction, 10, :with_lots, lots_size: 10, start_date: 5.years.ago,
end_date: 4.years.ago
end