- i3wm
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
// ES7, async/await | |
function sleep(ms = 0) { | |
return new Promise(r => setTimeout(r, ms)); | |
} | |
(async () => { | |
console.log('a'); | |
await sleep(1000); | |
console.log('b'); | |
})() |
Escolhi tratar sobre esse assunto hoje simplesmente porque foi uma das primeiras coisas que me perguntei "como eu faço isso?" no mundo ruby. Acredito que muita gente se pergunte a mesma coisa e espero que eu possa ajudar em algo para elas. 😀
Bem, se você é um programador java, você chama sua gem de jar, se você é um programador C#, você chama de dll. Resumindo, é uma lib, uma biblioteca contendo códigos que você pode reaproveitar importando em outros projetos.
E usar gems no ruby é muito fácil, se você já deu uma brincada com rails por exemplo, é só você adicionar o código gem 'nome_da_gem'
no arquivo Gemfile
que está no root, depois executar o comando bundle install
para baixar sua gem do repositório e pronto, só sair usando a biblioteca!
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
// Timeout | |
const p1 = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve("Resolve promise 1"); | |
}, 3000); | |
}); | |
const p2 = new Promise((resolve, reject) => { | |
setTimeout(() => { |
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
# 1 - quantidade de funcionario por loja com salario acima de 4000 reais | |
select l.nome, count(*) 'nº func. salario maior que 4000' | |
from funcionario f, loja l | |
where (f.loja_id = l.loja_id ) and (f.salario > 4000 ) | |
group by l.loja_id; | |
# 2 - Quantidade de pedidos para cada forma de pagamento |
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
sudo apt install git | |
sudo apt install curl | |
sudo apt install vim | |
# rails essentials | |
sudo apt-get install openssh-server libxml2 libxml2-dev libxslt1-dev libmysqlclient-dev nodejs libqt4-dev libqtwebkit-dev -y | |
# alternativa para extrair arquivos zipados | |
sudo apt install dtrx |
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
{ | |
"paradas": [{ | |
"nome": "DCE", | |
"latitude": -22.8963918240, | |
"longitude": -43.1258200000, | |
"rota_id": 1, | |
"proximo_id": 2, | |
"anterior_id": "" | |
}, | |
{ |