Skip to content

Instantly share code, notes, and snippets.

Américo Duarte americodls

Block or report user

Report or block americodls

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
americodls / Dockerfile
Last active May 20, 2019
Docker & Docker Compose para aplicações rails
View Dockerfile
FROM ruby:2.5.1
ARG user
ARG uid
RUN test -n "$user"
RUN test -n "$uid"
ENV BUILD_DEPS="build-essential"
ENV RAILS_GEM_DEPS="tzdata less postgresql-client"



Waiving meetings

In some cases the IC might determine that a PM meeting for the incident isn't needed. If the IC decides to waive the meeting please replace the Meeting section with a note indicating the meeting has been waived (example: Meeting waived: Paul Mooring)

americodls / function.rb
Created Jun 7, 2018
Create an object that is an improvement over Proc (curried by default and better inspection for debug)
View function.rb
class Function
attr_reader :arity, :source_location
def initialize(&block)
unless block_given?
message = "tried to create #{} object without a block"
raise(ArgumentError, message)
@arity = block.arity
americodls / rubocop.rb
Created Nov 10, 2017 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
View rubocop.rb
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
# Here are some options you can pass in addition to the ones in rubocop:
americodls / rubocop_pre_commit_hook
Created Oct 31, 2017 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
View rubocop_pre_commit_hook
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
americodls / sign_in.rb
Created Feb 17, 2015
Interface proposal for ServiceObject/Interactor/UseCase on rails
View sign_in.rb
class SessionsController < ApplicationController
def create{
success: ->(message) { redirect_to dashboard_user_path, notice: t(message) },
failure: ->(message) { render :new, error: t(message) }
module ToDoList
americodls / mediator.js
Last active Sep 22, 2015
Pub/Sub pattern using only jQuery.
View mediator.js
window.mediator = $({});
$(function() {
mediator.on("foo:bar", fooBar);
function fooBar(event) {
alert("Foo Bar");
You can’t perform that action at this time.