Skip to content

Instantly share code, notes, and snippets.

View fabiode's full-sized avatar
🏠
sono a casa mia.

Fabio Daguer Esposito fabiode

🏠
sono a casa mia.
  • Italy
View GitHub Profile
@fabiode
fabiode / example.rb
Created January 18, 2022 17:52
Adding a concern for image size variants for ActiveStorage, similar on how paperclip gem used to do
### Example of Use
class User < ApplicationRecord
include ImageVariants
has_one_attached :avatar
image_variants_for :avatar, sizes: { custom_size: }, default_image: '/path/to/default/image'
end
@fabiode
fabiode /
Created November 23, 2021 12:04
трудящихся мира, объединиться! Workers of the world, unite! Trabalhadores do mundo, uní-vos! Proletarier aller Länder, vereinigt euch!
#!/usr/bin/env bash
echo ' '
echo ' '
echo "☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ "
echo "================================== трудящихся мира, объединиться! ===================================="
echo "☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ . ☭ "
echo ' '
echo "****************,**,*****,***,,,,,,,....,........,................................... ..............
*****,***,****,,,,,**,,**,*,,,,,,,,,.......,**,..,.............................. ...... ... .......
import { Controller } from "stimulus"
import Inputmask from 'inputmask';
export default class extends Controller {
static targets = ['employees', 'amount', 'fullresult', 'result', 'economy', 'resultContent', 'calculator', 'id', 'emailBtn', 'leadBtn']
connect(){
this.params = ['employees', 'amount', 'fullresult', 'result', 'economy', 'id']
var _component = this
this.state = 'valid'
var im = new Inputmask('999,99')
<div class="poupador-simulator" data-controller="poupador">
<% lead = local_assigns[:newsletter_lead] || @newsletter_lead %>
<%= hidden_field_tag 'lead[id]', lead.try(:id), data: { target: 'poupador.id', path: send_email_newsletter_leads_path } %>
<p class="t-light-gray text-center">Esta é apenas uma simulação aproximada da sua economia.</p>
<span class="hr very-light-gray"></span>
<div data-target="poupador.calculator">
<div class="row">
<div class="col text-center">
<%= image_pack_tag 'images/icons/icone-colaboradores.png', style: 'max-width: 100px;' %>
<h6 class="t-light-gray">Número de Colaboradores</h6>
@fabiode
fabiode / cxx
Created May 18, 2016 15:59
Cloud66 json substition for CX Toolbelt fast exchange between users
#!/bin/bash
file="$HOME/.cloud66/$1.json"
if [ -f "$file" ]
then
echo "$file found."
echo "erasing old cx.json, replacing for $1.json"
rm -rf "$HOME/.cloud66/cx.json"
ln -s $file "$HOME/.cloud66/cx.json"
else
echo "$file not found."
def bulletin_content(bulletin)
if bulletin.is_image?
image_tag bulletin.asset.url(:large)
else
link_to image_tag('download_arquivo.png'), @bulletin.asset.url(:original)
end
end