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
DummyGist |
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
<?php | |
/** | |
* CakePHP Debug Level: | |
* | |
* Production Mode: | |
* 0: No error messages, errors, or warnings shown. Flash messages redirect. | |
* | |
* Development Mode: | |
* 1: Errors and warnings shown, model caches refreshed, flash messages halted. | |
* 2: As in 1, but also with full debug messages and SQL output. |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
import java.util.Scanner; | |
import MaquinaRefrigerante; | |
public class MainMachine{ | |
public static void main(String[] args) { | |
MaquinaRefrigerante machine = new MaquinaRefrigerante(); | |
// TODO: ajeitar a sintaxe | |
// machine.showOptions(); |
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
/** | |
* @name Show Password | |
* @descripton | |
* @version 1.4 | |
* @requires Jquery 1.5 | |
* | |
* @author Jan Jarfalk | |
* @author-email [email protected] | |
* @author-website http://www.unwrongest.com | |
* |
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 intervalo_a_b (n1,n2) | |
if(n1.class != Fixnum or n2.class != Fixnum) then | |
-1 | |
else | |
if(n1 < n2) then | |
(n1..n2).to_a | |
else | |
(n2..n1).to_a | |
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
class Cachorro | |
attr_accessor :raca, :nome, :idade | |
def aniversario() | |
@idade = self.idade + 1 | |
end | |
def latir() | |
latido = "Au" | |
if(self.idade > 0 and self.idade <= 5) then |
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
numero1 = gets.to_i | |
numero2 = gets.to_i | |
resultado = if(numero1 == numero2) then "Iguais" else "Diferentes" end | |
puts resultado |
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
#entradas | |
qtd_combustivel_c1 = gets.to_i | |
consumo_combustivel_c1 = gets.to_f | |
velocidade_c1 = gets.to_i | |
velocidade_c2 = gets.to_i | |
distancia_c1c2 = gets.to_i | |
#calculos | |
tempo_encontro = distancia_c1c2.to_f / (velocidade_c1.to_f + velocidade_c2.to_f) | |
ponto_encontro = velocidade_c1 * tempo_encontro |
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
distancia_cidades = gets.to_i # km | |
velocidade_o1 = gets.to_i # km/h | |
velocidade_o2 = gets.to_i # km/h | |
tempo_operacao = gets.to_f # h | |
valor_litro_combustivel = gets.to_f | |
custo_onibus_parado = gets.to_f | |
# para So1 = So2 (quando ambos estiverem no mesmo ponto) | |
# tempo para o encontro | |
tempo_de_encontro = distancia_cidades.to_f / (velocidade_o1 + velocidade_o2).to_f |
NewerOlder