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 [ | |
| [ | |
| 'name' => 'Jhon', | |
| 'email' => 'jhon@email.com', | |
| 'avatar' => 'http://avatar.com/avatar.png', | |
| 'active' => true, | |
| 'creation' => '20/12/2021 12:00h', | |
| 'links' => [ |
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
| @if($errors->any()) | |
| <div class="alert alert-danger"> | |
| <p><strong>Opps Something went wrong</strong></p> | |
| <ul> | |
| @foreach ($errors->all() as $error) | |
| <li>{{ $error }}</li> | |
| @endforeach | |
| </ul> | |
| </div> | |
| @endif |
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
| const redisSender = new Redis({ | |
| host: proccess.env.REDIS_HOST, | |
| password: 'proccess.env.REDIS_PASS, | |
| port: proccess.env.REDIS_POST, | |
| }); | |
| redisSender.publish('cwr-channel', JSON.stringify({ event: 'event.name', data: { teste: 123 } })); |
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 | |
| function salvaDadosUsuario($conta, $total) { | |
| // | |
| } | |
| // declarando os tipos esperados e o tipo do retorno | |
| function salvaDadosUsuario(ContaUsuario $conta, float $total): bool { | |
| // | |
| } |
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 | |
| $quantidadeUsuarios = 10; | |
| $usuarios = [...]; |
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 | |
| $valor = ''; | |
| if (empty($valor)) { | |
| echo 'Sim! Estou vazio!' . PHP_EOL; | |
| } | |
| if (isset($valor)) { | |
| echo 'Sim! Eu existo na memória!' . PHP_EOL; |
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 | |
| $valor = "Lorem ipsum"; | |
| if (is_string($valor)) { | |
| echo "Oi! Sou uma string!"; // Irá entrar aqui | |
| } | |
| $valor = 123; | |
| if (is_numeric($valor)) { | |
| echo "Agora sou um número!"; // Irá entrar aqui |
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 class LoremIpsum { | |
| public static void main(String args[]) { | |
| int valor = 10; | |
| valor = "Lorem ipsum!"; | |
| } | |
| } |
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 | |
| $directory = `pwd`; // há outras maneiras, só pra exemplificar | |
| echo $directory; // /var/www/html/meu-site-foda | |
| $whoami = `whoami`; | |
| echo $whoami; // user |
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
| const element = document.querySelector('#example'); | |
| const name = "Tadeu Barbosa"; | |
| element.innertHtml = `Meu nome é <strong>${name.split(' ')[0]}</strong>`; |