Skip to content

Instantly share code, notes, and snippets.

View lucascaton's full-sized avatar

Lucas Caton lucascaton

View GitHub Profile
@lucascaton
lucascaton / itunes_match_tips.txt
Created June 10, 2012 22:10 — forked from rmhall/itunes_match_tips.txt
iTunes Match tips
My iTunes Match Track upgrading and process info:
If you have less than 25,000 tracks:
1. First let iTunes Match do its things and find all possible matches in your library and finish uploading any non-matching tracks.
2. Once its done, make a new Smart Playlist (I made a folder for all my Smart iTunes Match Related Playlists)
Name this one: iCloud-Upgradeable
Criteria:
MATCH ALL:
Bit Rate is less than 256kbps
@lucascaton
lucascaton / gist:2420977
Created April 19, 2012 13:27 — forked from fnando/gist:2420869
My JavaScript Guidelines
@lucascaton
lucascaton / application.rb
Created April 14, 2012 04:28 — forked from ugisozols/application.rb
assets lazily compiled in production
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
# Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env)
end
@lucascaton
lucascaton / 0-readme.md
Created March 11, 2012 23:41 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

# You can check if current symbol is equivalent the question string
#
# e.g.:
# :symbol.symbol? # => true
# :symbol1.symbol1? # => true
# :sym_bol.sym_bol? # => true
# :"sym-bol".sym_bol? # => true
# :"sym bol".sym_bol? # => true
class Symbol
def method_missing(meth, *args, &blk)
@lucascaton
lucascaton / gist:1289707
Created October 15, 2011 15:26 — forked from ferbass/gist:1289704
GitIgnore for xcode 4.x
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
!default.xcworkspace
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
@lucascaton
lucascaton / LICENSE.txt
Created September 28, 2011 18:40 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@lucascaton
lucascaton / cpf_cnpj_validators.rb
Created July 27, 2011 14:40 — forked from gouvermxt/cpf_cnpj_validators.rb
validação de CPF e CNPJ em Ruby
#------------------------------------------------------------------------------
# Rotinas para verificação de CPF e CNPJ
# Linguagem: Ruby
# Escrito por: André Camargo < andre@boaideia.inf.br > http://blog.boaideia.inf.br
# Use, copie, melhore a vontade! Patches são bem-vindos...
#------------------------------------------------------------------------------
def check_cpf(cpf=nil)
return false if cpf.nil?
nulos = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000}
#
# Pra quem ficou com preguiça de ficar dando refresh na página da polícia
# federal na hora de solicitar o passaporte
#
require 'rubygems'
require 'net/http'
require 'uri'
cpf = "1234567890"
pt-BR:
errors:
messages:
expired: 'expirou, por favor solicite um novo'
not_found: 'não encontrado'
already_confirmed: 'já foi confirmado, por favor tente fazer login'
not_locked: 'não estava bloqueado'
not_saved:
one: "1 erro impediu que %{resource} fosse salvo:"
other: "%{count} erros impediram que %{resource} fosse salvo:"