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
########################################## | |
# To run: | |
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
########################################## | |
# Check that HTTPS transport is available to APT | |
if [ ! -e /usr/lib/apt/methods/https ]; then | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https | |
fi |
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/bash | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo rm -f /etc/apt/sources.list.d/docker.list | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | tee /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual | |
sudo apt-get install docker-engine |
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
``` | |
let scope = "global" // declara uma variável global | |
function checkscope() { | |
let scope = "local"; // declara uma variável local com o mesmo nome da global | |
return scope; | |
} | |
checkscope(); | |
> saída: "local" |
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
scope = "global"; // declara uma variável global mesmo sem var | |
function checkscope2() { | |
scope = "local"; // alterando o valor da variável global pela local | |
myScope = "local"; // adicionando uma nova variável global mesmo dentro da função | |
return [scope, myScope]; // retornando os dois valores declarados dentro da function | |
} | |
checkscope2(); // ["local", "local"]: temos efeitos colaterais aqui, esperavamos **["global, local"]** |
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
function { | |
// seu código aqui | |
} |
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
function test(o) { | |
var i = 0; // i está definida para toda a função | |
if (typeof o == "object") { | |
var j= 0; | |
for (var k=0; k <=10; k++) { | |
console.log(k); | |
} | |
console.log(k); | |
} |
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
var name = 'Opensanca'; | |
function sayName() { | |
console.log(name); | |
var name = 'Opensanca'; | |
} | |
sayName(); | |
> Saída obtida: name is not defined |
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
``` | |
let name = 'Opensanca'; | |
function sayName() { | |
console.log(name); | |
let name = 'Opensanca'; | |
} | |
sayName(); |
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
let name = 'Opensanca'; // nossa variável global | |
function sayName() { | |
let name; // nossa variável local de mesmo nome que a global | |
console.log(name); // chamando a variável local dentro da function | |
let = "Opensanca"; // nossa variavel global foi para dentro da function pois ocorreu o hoisting e com isso não temos nenhuma atribuição global para o JS o que resulta em `undefined` | |
} |
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
/* ======================= | |
States Rules | |
==========================*/ | |
.is-visible { | |
display: block | |
} | |
.is-hidden { | |
display: none; | |
} |
OlderNewer