Skip to content

Instantly share code, notes, and snippets.

View mrbongiolo's full-sized avatar
🚀
Just shiplling

Ralf Schmitz Bongiolo mrbongiolo

🚀
Just shiplling
View GitHub Profile
@mrbongiolo
mrbongiolo / send_wrapped_2020_emails.rb
Last active December 4, 2020 13:54
Using u-case to process a json file
# frozen_string_literal: true
module StocksGames
class SendWrapped2020Emails < Micro::Case::Strict
attribute :file_path
def call!
parse_json
.then(apply(:group_by_user))
.then(apply(:collect_name_and_valid_wallets))
@mrbongiolo
mrbongiolo / css-simple-progress-bar.md
Last active August 26, 2021 13:10
Super simple progress bar using CSS variables

The CSS:

.simpleBar {
  --barMax: 100;
  --barCurrent: 0;
  display: block;
  width: 100%;
  height: 20px;
@mrbongiolo
mrbongiolo / README.md
Created August 24, 2020 21:44
Micro::Case::Result rspec matchers
@mrbongiolo
mrbongiolo / index.slim.erb
Last active July 18, 2020 21:36
Categories Index Example
.d-flex.align-items-center.justify-content-space-between
h3
| Listando categorias
= button_to 'Nova Categoria', new_category_path, method: :get, class: 'btn btn-primary'
table.table.table-hover
thead
tr
th
| Descrição
@mrbongiolo
mrbongiolo / OPERATION_README.md
Last active October 26, 2020 00:41
Ruby on Rails Operation

An operation using the module:

module Api
  module V1
    module Page
      class Update
        include Operation

        attr_reader :resource
@mrbongiolo
mrbongiolo / README.md
Last active November 18, 2019 15:03
coordinators and projects

Cria os scopes lá no model de Coordinator, assim fica mais fácil organizar. PS: não esqueça de testar isso, não tenho certeza se está funcionando corretamente, só escrevi diretamente aqui no gist.

scope :assigned_to_project, ->(id) { left_outer_joins(:project).where(projects: { id: id }) }
scope :without_projects, -> { assigned_to_project(nil) }
scope :without_projects_or_assigned_to_project, ->(id) { without_projects.or(assigned_to_project(id)) }

No teu controller pode fazer algo assim:

@mrbongiolo
mrbongiolo / __steps.md
Created April 29, 2017 13:09
Enable docker user namespace on Solus

Steps on how to enable Docker User Namepsace on Solus

  1. Create the subuid file:
sudo nvim /etc/subuid

# content
myusername:1000:1
myusername:100000:65536
@mrbongiolo
mrbongiolo / swapesc
Created September 24, 2016 22:50 — forked from berkes/swapesc
#!/bin/bash
current=$(dconf read /org/gnome/desktop/input-sources/xkb-options)
swapped="['caps:swapescape']"
capslock="['caps:capslock']"
echo "Current status: $current"
if [ "$current" == "$swapped" ]
then
echo "Making caps and escape WORK NORMALLY"
@mrbongiolo
mrbongiolo / LSI_how_to_build.md
Last active September 14, 2016 16:15
HOW TO build linux-steam-instegration on ElementaryOS Loki

for those noobs like me

git clone git@github.com:solus-project/linux-steam-integration.git
cd linux-steam-integration
./autogen.sh --with-real-steam-binary=/usr/games/steam --enable-frontend
sudo make
sudo checkinstall --pkgname=linux-steam-integration --pkgversion=0.2 --provides=linux-steam-integration