To install packages from this channel, just add it to Package Control. Enable the command palette and type 'Add Repository'. Then paste the following URL: https://gist.githubusercontent.com/fnando/56393d3900af55bf9e94/raw/repositories.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
helper_method \ | |
def current_user | |
# some stuff | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function usage() { | |
echo "Usage: $0 <source_redis> <destination_redis> <key_pattern>" | |
echo " <source_redis> - Source server hostname" | |
echo " <destination_redis> - Destination server nostname" | |
echo " <key_pattern> - Keys to copy (Like Redis KEYS pattern)" | |
exit 0 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
GC.disable | |
CYCLES = 1_000_000 | |
SINGLE_QUOTES = 'string' | |
DOUBLE_QUOTES = "string" | |
Benchmark.ips do |x| | |
x.report('double quotes') { b = DOUBLE_QUOTES } | |
x.report('single quotes') { a = SINGLE_QUOTES } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conf_files = Dir[Rails.root.join('config/*.yml')] | |
if conf_files.any? | |
configs = {} | |
conf_files.each do |filename| | |
key_name = File.basename(filename).gsub(File.extname(filename), '') | |
begin | |
configuration = YAML.load_file(filename)[Rails.env] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen local.app.com:80; | |
server_name local.app.com; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; |
https://www.youtube.com/watch?v=cPbl26Fw-dk
- Quer brincar de Eike Bastista nessa porra!
- Matar um leão por dia.
- Faca nos dentes
- Sangue no olho
- É matar ou morrer
- Dando muque em macaco de gaveta
- É largar mato na caçamba
- Jogar terra na boca de carrapato
Copy
linkYU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BANK_RULES ||= YAML::load(ERB.new(File.read(Rails.root.join('bank_rules.yml'))).result) | |
BANK_RULES.default = BANK_RULES['default'] | |
def BANK_RULES.[](key, attribute = nil) | |
attributes = super(key) | |
return attributes if attribute.nil? | |
attributes[attribute] | |
end | |
class Bank |