-
Clonei o meu fork: git clone https://github.com/kidchenko/code-cracker.git
-
Adicionei um remote para o repositório original: git remote add upstream https://github.com/code-cracker/code-cracker.git *upstream é o nome do meu remote, poderia ser outro nome.
-
Atualizei o remote upstream git fetch upstream Para atualizar meu repositório local, prefiro usar um git fetch, ao invés de um pull.
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 | |
$address = 'avenida+gustavo+paiva,maceio,alagoas,brasil'; | |
$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false'); | |
$output= json_decode($geocode); | |
$lat = $output->results[0]->geometry->location->lat; | |
$long = $output->results[0]->geometry->location->lng; |
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
-> Vantagens de uso da nuvem: | |
- Trocar investimento em ativos por custos operacionais. | |
Custos tende a ser mais aderentes aos negócios. | |
- Benefício de escala massivo. | |
Quanto maior a estrutura, maior uso de uma estrutura robusta, mais barato deve se tornar o módulo. | |
- Parar de estimar/chutar a capacidade do data center. | |
Na nuvem, pela elasticidade, poderá escalar conforme a necessidade. |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
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 Errors { | |
/** | |
* Create a new Errors instance. | |
*/ | |
constructor() { | |
this.errors = {}; | |
} | |
/** |
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
ADMIN_EMAILS=[email protected],[email protected] |
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
public function setTitleAttribute($value) | |
{ | |
$slug = \Str::slug($value); | |
$count = static::whereRaw("slug RLIKE '^{$slug}(-[0-9]+)?$'")->count(); | |
$this->attributes['title'] = $value; | |
$this->attributes['slug'] = $count ? "{$slug}-{$count}" : $slug; | |
} |
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 Category extends Model | |
{ | |
public function categories() | |
{ | |
return $this->hasMany(Category::class); | |
} | |
public function childrenCategories() |
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
function telefone($n) | |
{ | |
$tam = strlen(preg_replace("/[^0-9]/", "", $n)); | |
if ($tam == 13) { | |
// COM CÓDIGO DE ÁREA NACIONAL E DO PAIS e 9 dígitos | |
return "+".substr($n, 0, $tam-11)." (".substr($n, $tam-11, 2).") ".substr($n, $tam-9, 5)."-".substr($n, -4); | |
} | |
if ($tam == 12) { | |
// COM CÓDIGO DE ÁREA NACIONAL E DO PAIS |
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 'vendor/autoload.php'; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
$mail = new PHPMailer(true); | |
$mail->CharSet = 'UTF-8'; | |
$mail->setLanguage('pt_br'); | |
$mail->SMTPDebug = 0; | |
$mail->isSMTP(); |
NewerOlder