{
"name": "assando-sites",
"require": {
"cakephp/cakephp": ">=2.5.0",
"ext-apcu": "*",
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
INSERT INTO `states` (`id`, `name`, `code`) VALUES (1, 'Acre', 'AC'); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Acrelândia', -9.825808, -66.897166); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Assis Brasil', -10.929765, -69.573794); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Brasiléia', -10.994994, -68.749696); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Bujari', -9.815277, -67.955029); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Capixaba', -10.566031, -67.686006); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Cruzeiro do Sul', -7.627625, -72.675582); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Epitaciolândia', -11.018771, -68.734109); | |
INSERT INTO `cities` (`state_id`, `name`, `latitude`, `longitude`) VALUES (1, 'Feijó', -8.170536, -70.350973); | |
INSERT INTO `cities` (` |
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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
if ENV['coverage'] == 'on' | |
require 'simplecov' | |
SimpleCov.start 'rails' do | |
minimum_coverage 100 | |
end | |
end | |
ENV['RAILS_ENV'] ||= 'test' |
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 | |
/** | |
* Bcrypt hashing class | |
* | |
* @author Thiago Belem <contato@thiagobelem.net> | |
* @link https://gist.github.com/3438461 | |
*/ | |
class Bcrypt { |
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
pragma solidity ^0.4.17; | |
contract Lottery { | |
address public manager; | |
address[] public players; | |
uint minEntry = .01 ether; | |
uint managerFee = .01 ether; | |
constructor() public { | |
manager = msg.sender; |
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 | |
// Cria um cookie chamado 'usuario' com o valor 'Fulano' | |
setcookie('usuario', 'Fulano'); | |
// Cria o mesmo cookie acima só que irá durar três dias | |
setcookie('usuario', 'Fulano', (time() + (3 * 24 * 3600))); | |
// Cria o novo cookie para durar duas horas | |
setcookie('nome', 'Ciclano', (time() + (2 * 3600))); |
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 | |
/** | |
* Gera um salt aleatório | |
* | |
* @param int $tamanho Tamanho do salt | |
* | |
* @return string | |
*/ | |
function geraSaltAleatorio($tamanho = 22) { |
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 python | |
def MultiploDeTres(numero): | |
return not numero % 3 | |
def MultiploDeCinco(numero): | |
return not numero % 5 | |
def FizzBuzz(numero): | |
if MultiploDeTres(numero) and MultiploDeCinco(numero): |
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 | |
// Encriptando a senha | |
$senha = 'ola mundo'; | |
$hash = Bcrypt::hash($senha); | |
// $hash = $2a$08$MTgxNjQxOTEzMTUwMzY2OOc15r9yENLiaQqel/8A82XLdj.OwIHQm | |
// Salve $hash no banco de dados | |
// Verificando a senha | |
$senha = 'ola mundo'; |
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/sh | |
USER="root"; | |
PASS="pass"; | |
# Run a mysql command as root | |
mysqlcommand() { | |
echo "$@"; | |
mysql -u"$USER" -p"$PASS" -e "$@"; | |
} |
NewerOlder