This file contains 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
module ApplicationHelper | |
def path_to_resource(source) | |
generate_path(source) | |
end | |
private | |
def generate_path(source) | |
has_request = @controller.respond_to?(:request) | |
This file contains 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
if RUBY_PLATFORM =~ /java/ and ENV['RAILS_ENV'] == 'production' | |
require 'java' | |
config.log_path = java.lang.System.getProperty('catalina.home') + '/logs/migrador_inep.log' | |
config.logger = Logger.new(config.log_path) | |
config.logger.level = Logger::INFO | |
end |
This file contains 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 LogFormatter | |
def call(severity, time, program_name, message) | |
datetime = time.strftime("%d/%m/%Y %H:%M:%S") | |
process = "rails[#{$PID}]" | |
hostname = Socket.gethostname.split('.')[0] | |
message = (String === message ? | |
message : message.inspect).gsub(/\n/, '').strip | |
"#{datetime} #{hostname} #{process}: #{message}\n" | |
end | |
end |
This file contains 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
Você não perde nada fazendo esses updates. Esses updates são apenas para o nexus S I9029T. | |
Para atualizar o android da 2.3.1 (confira a versão do seu) para a 2.3.3 siga os passos a seguir: | |
1 - Baixe o update 2.3.2 do site do google http://android.clients.google.com/packages/ota/google_crespo/353e267378cd.signed-soju-GRH78C-from-GRH78.353e2673.zip | |
1.1 - Copie o update para o cartão SD (não precisa renomear) | |
1.2 - Desligue o celular e religue segurando a tecla aumentar volume e o power | |
1.3 - Selecione recovery no bootloader | |
1.4 - Quando aparecer um triângulo aperte segure o botão de power e aperte o aumentar volume | |
1.5 - Escolha aplicar update a partir do cartão de memória |
This file contains 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/bash | |
PCRE=pcre-8.12 | |
NGINX=nginx-1.0.4 | |
## DOWNLOADS | |
sudo curl -OL h ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$PCRE.tar.gz > /usr/local/src/$PCRE.tar.gz | |
sudo curl -OL h http://nginx.org/download/$NGINX.tar.gz > /usr/local/src/$NGINX.tar.gz | |
## Install PCRE |
This file contains 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
#!/usr/bin/env ruby | |
#encoding: utf-8 | |
require 'rubygems' | |
require 'terminal-display-colors' | |
projects_dir = File.expand_path(ARGV[0] || "~/Projetos") | |
puts "ProjectsDir: #{projects_dir}\n".blue | |
projects = Dir.new(projects_dir).entries. |
This file contains 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
WM.Effect.FADE_TICK = 10; | |
WM.Effect.Exception = function(message) { | |
this.message = message; | |
}; | |
/** | |
* Options: | |
* duration: int, | |
* maxFade: float (0 to 1) Default: 1 |
This file contains 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
def fibonacci number | |
number <= 1 ? number : (fibonacci(number - 1) + fibonacci(number - 2)) | |
end |
This file contains 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
var destaque = $("#slide-container").destaque({ | |
itemSelector: ".item", | |
itemBackgroundSelector: ".background", | |
itemForegroundElementSelector: ".foreground .element", | |
controlsSelector: "#slide-pagination a", | |
onPageUpdate: function(destaque, pageData) { | |
$(".indicator .bullet").removeClass("active"); | |
$(".indicator .bullet[rel='"+ pageData.currentSlide +"']").addClass("active"); | |
} | |
}); |
This file contains 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
.item img, .item .foreground { | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
} |
OlderNewer