Skip to content

Instantly share code, notes, and snippets.

View caironoleto's full-sized avatar

Cairo Noleto caironoleto

View GitHub Profile
@lucashungaro
lucashungaro / config.ru
Created October 31, 2013 16:36
Unicorn + Heroku + worker_killer + GC vars tweak
# This file is used by Rack-based servers to start the application.
# GC_FREQUENCY = 8
# require "unicorn/oob_gc"
# GC.disable # Don't run GC during requests
# use Unicorn::OobGC, GC_FREQUENCY # Only GC once every GC_FREQUENCY requests
# # Unicorn self-process killer
require "unicorn/worker_killer"
//= require chosen.jquery.js
!(function (angular) {
"use strict";
angular.module('ui.chosen', [])
.value('chosenConstants', {
'REGEXP': /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,
'WHITELIST': ['noResultsText', 'allowSingleDeselect', 'disableSearchThreshold', 'disableSearch']
})
@rafaelrosafu
rafaelrosafu / canada.md
Last active November 16, 2018 13:21
Imigrando e vivendo no Canadá - um guia nada imparcial
@joshuap
joshuap / honeybadger.rb
Created December 28, 2012 18:28
Using Honeybadger with Sidekiq
# config/initializers/honeybadger.rb
Honeybadger.configure do |config|
...
config.async do |notice|
WorkingBadger.perform_async(notice.to_json)
end
end
@caironoleto
caironoleto / nginx
Created April 3, 2011 17:44
Arquivo de inicialização do nginx
#! /bin/sh
. /lib/lsb/init-functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nginx
PS="nginx"
PIDNAME="nginx" #lets you do $PS-slave
PIDFILE=$PIDNAME.pid #pid file
PIDSPATH=/var/run
@akitaonrails
akitaonrails / iptables.rules
Created December 26, 2010 20:54
A configuração de iptables que uso em meus servidores pessoais.
# Generated by iptables-save v1.4.2 on Wed Feb 10 02:27:40 2010
*raw
:PREROUTING ACCEPT [50797:74255039]
:OUTPUT ACCEPT [25636:1371004]
COMMIT
# Completed on Wed Feb 10 02:27:40 2010
# Generated by iptables-save v1.4.2 on Wed Feb 10 02:27:40 2010
*nat
:PREROUTING ACCEPT [152:51984]
:POSTROUTING ACCEPT [41:2614]
@lucashungaro
lucashungaro / links.textile
Created August 14, 2010 16:36
Links de referência utilizados em minha palestra
@vvalgis
vvalgis / Capistrano tasks for starting unicorn.rb
Created May 7, 2010 08:13
Capistrano tasks for starting unicorn
set :rails_env, :production
set :unicorn_binary, "/usr/bin/unicorn"
set :unicorn_config, "#{current_path}/config/unicorn.rb"
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@caironoleto
caironoleto / tuning-primer.sh
Created December 18, 2009 13:08
MySQL Tuning Primer
#!/usr/bin/env bash
#########################################################################
# #
# MySQL performance tuning primer script #
# Writen by: Matthew Montgomery <mmontgom@rackspace.com> #
# Inspired by: MySQLARd (http://gert.sos.be/demo/mysqlar/) #
# Version 1.2-r6 #
# Licenced under GPLv2 #
# #