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
<?php | |
return [ | |
// http://www.cidades.ibge.gov.br/download/mapa_e_municipios.php?uf=ac (Thu May 14 16:30:15 BRT 2015) | |
'AC' => [ | |
1200013 => 'Acrelândia', | |
1200054 => 'Assis Brasil', | |
1200104 => 'Brasiléia', | |
1200138 => 'Bujari', | |
1200179 => 'Capixaba', |
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
psr4.add('Gabrieljmj\\Blog\\', 'modules/gabrieljmj/blog/'); | |
psr4.add('Gabrieljmj\\Blog\\Controller\\', 'modules/gabrieljmj/blog/constrollers/'); | |
var postsController = psr4.use('Gabrieljmj\\Blog\\Posts'); //require('modules/gabrieljmj/blog/Posts') | |
var postsController = psr4.use('Gabrieljmj\\Blog\\Controller\\Posts'); //require('modules/gabrieljmj/blog/controllers/posts') |
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
<?php | |
class Environment | |
{ | |
private $shouldState; | |
private $verbs = array('be', 'have'); | |
private $toTest; | |
public function __construct($toTest, $shouldState = false, $verb = null) | |
{ | |
$this->toTest = $toTest; |
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
<?php | |
namespace Gabrieljmj; | |
trait HideStaticMethods | |
{ | |
public function __call($method, $args) | |
{ | |
return foward_static_call_array(array(self, $method), $args); | |
} | |
} |
####Why numbering should start at one
####Example
$arr = new SenseArr();
$arr[] = 'foo';
print_r($arr);
Result
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
$images = array( | |
1 => 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSwN2pF0jnnNlxtNRythauTtBgtNFTSx0ucRHeKfahoo33XEtFjUEYVfnE', | |
2 => 'http://i7.photobucket.com/albums/y266/Linkforce712/SEA01.png' | |
); | |
$arr = array(1, 1, 1, 1, 1, 1); | |
$arr2 = array(1, 2, 2, 2, 2, 1); | |
$arr3 = array(1, 1, 1, 1, 1); | |
function transform($images) |
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
<?php | |
print_r(quadEq(1, 2, 1));// a=1 b=2 c=3 (x² + 2x + 3 = 0) | |
//Result: array(-1) |
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
<?php | |
if( isset( $_SERVER['HTTP_REFERER'] ) and !stristr( $_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'] ) ){ | |
//... | |
} |
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
<?php | |
/** | |
* @author @GabrielJMJ /twitter | |
* @description Abstract class to define a interface of a converter | |
* @link https://gist.github.com/GabrielJMJ/6977968 Gist on GitHub | |
**/ | |
abstract class Converter{ | |
protected $valueWithCurrency; | |
protected $toCurrency; |