Skip to content

Instantly share code, notes, and snippets.

@tiagoamaro
tiagoamaro / apps.md
Last active November 1, 2025 05:55
Mac Apps

Apps available on all platforms

Cerebro App (Mac's alfred replacement)

@tiagoamaro
tiagoamaro / delayed_job_config.rb
Last active December 31, 2015 17:29
Delayed Job default configurations
# config/initializers/delayed_job_config.rb
Delayed::Worker.destroy_failed_jobs = true
Delayed::Worker.sleep_delay = 5
Delayed::Worker.max_attempts = 25
Delayed::Worker.max_run_time = 4.hours
Delayed::Worker.read_ahead = 5
Delayed::Worker.default_queue_name = 'default'
Delayed::Worker.delay_jobs = true # or use "!Rails.env.test?"
@tiagoamaro
tiagoamaro / .gitconfig
Last active February 27, 2025 12:25
Git Graph
# Configuration based on https://blog.gitbutler.com/how-git-core-devs-configure-git/
# Also, git graph idea from: https://coderwall.com/p/mlozoa
[alias]
graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset'
[user]
email = TODO@REPLACE-EMAIL
name = Tiago Amaro
[merge]
tool = vscode
@tiagoamaro
tiagoamaro / alfred_custom_searches.md
Last active August 29, 2015 14:02
Alfred Custom Searches

Bower: alfred://customsearch/Bower%20Search%20%7Bquery%7D/bower/utf8/noplus/http://bower.io/search/?q={query}

Github: alfred://customsearch/Github/github/utf8/plus/https://github.com/search?q={query}

Mercado Livre: alfred://customsearch/Mercado%20Livre/mercado/utf8/noplus/http://lista.mercadolivre.com.br/{query}

RubyGems: alfred://customsearch/Ruby%20Gems/ruby/utf8/noplus/https://rubygems.org/search?query={query}

Sublime Package Control: alfred://customsearch/Sublime%20Package%20Control%20Search/subl/utf8/noplus/https://packagecontrol.io/search/{query}

@tiagoamaro
tiagoamaro / Procfile
Last active August 29, 2015 14:05 — forked from jayzes/Procfile
foreman and thinking sphinx (3.x) [source: https://gist.github.com/madhums/1161840]
sphinx: bundle exec rake ts:run_in_background
# unicorn
description "unicorn ruby app server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [!2345]
env WORKDIR=/data
env PIDFILE=/data/tmp/pids/unicorn.pid
env CFGFILE=/data/config/unicorn.rb
@tiagoamaro
tiagoamaro / about.md
Last active May 15, 2021 00:04
searchkick-apartment-example-codes
@tiagoamaro
tiagoamaro / many_to_many_self_join.rb
Created January 13, 2015 23:38
Rails many-to-many self-join
# as described in http://guides.rubyonrails.org/association_basics.html#self-joins
class User < ActiveRecord::Base
has_and_belongs_to_many :friends,
class_name: "User",
foreign_key: "this_user_id",
association_foreign_key: "other_user_id"
end
@tiagoamaro
tiagoamaro / example.sh
Last active August 29, 2015 14:19
Shell Script to globally install gems for all Rubies in a RVM installation
GEM_NAME=nokogiri GEM_VERSION=1.6.6.2 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.6.1 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.5 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.4.1 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.4 ./globally_install_gems.sh &
@tiagoamaro
tiagoamaro / installed-packages.md
Last active December 2, 2015 13:24
Atom Editor Configurations
  • pigments
  • save-session
  • sort-lines
  • trailing-spaces