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
stages: | |
- deploy | |
deploy_to_production: | |
image: php:5.6-cli | |
stage: deploy | |
only: | |
- master | |
environment: production | |
before_script: |
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 App\Entities; | |
use Laravel\Socialite\AbstractUser; | |
class FacebookUser extends AbstractUser {} |
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 Example | |
{ | |
public $subject; | |
public function __construct() | |
{ | |
$this->subject = 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
let color = "purple"; // escopo global. todo mundo tem acesso a ela | |
function belt () { | |
let color = "blue"; // redefinimos o valor de color somente dentro desse escopo | |
function myBelt () { | |
let color = "brown"; // redefinimos mais uma vez o valor de color para ser usado somente nesse escopo | |
console.log(color); // brown | |
} | |
myBelt(); // chamará a função myBelt que imprimirá brown |
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 showName (firstName, lastName) { | |
var nameIntro = "Your name is "; | |
//esta função interior tem acesso as variáveis da função exterior, incluindo os parâmetros | |
function makeFullName () { | |
return nameIntro + firstName + " " + lastName; | |
} | |
return makeFullName (); | |
} |
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
//-------------------------------------- | |
// --- ANONYMOUS FUNCTION VERSION --- // | |
function result (triple) { | |
return triple(3); | |
} | |
result(function (number) { | |
return number * 3; | |
}); |
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
portugueseHello = function () { | |
return "Olá, "; | |
} | |
englishHello = function () { | |
return "Hello, "; | |
} | |
francaisHello = function () { | |
return "Bonjour, "; |
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
$('a').on('click', function() { | |
console.log('fui pressionado'); | |
}); |
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
portugueseHello = function () { | |
return "Olá, "; | |
} | |
englishHello = function () { | |
return "Hello, "; | |
} | |
francaisHello = function () { | |
return "Bonjour, "; |
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
let warrior = { | |
hp: 100, | |
strength: 20, | |
attack: function(target) { | |
target.hp -= this.strength; | |
} | |
} | |
let enemy = { | |
hp: 100, |