Skip to content

Instantly share code, notes, and snippets.

View reoxb's full-sized avatar

Juan Suarez reoxb

View GitHub Profile
@reoxb
reoxb / install-docker-mint20.sh
Created June 12, 2021 02:57 — forked from dnavarrom/install-docker-mint20.sh
Install docker and docker compose en linux mint 20
#docker setup
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io pigz
#execution permission
sudo usermod -aG docker $USER
#docker compose
@reoxb
reoxb / promise.js
Created November 19, 2020 20:57
How promises works
function asyncFunction(x) {
return new Promise(function (resolve, reject) {
if(typeof x === 'number' && !isNaN(x)){
resolve( x * x)
} else {
reject(new Error('It\'s not a number'))
}
})
}
@reoxb
reoxb / async_await.js
Created November 19, 2020 17:50
Async/await Madrid JS DayES
(async function () {
const a = await asyncFunction(2)
const b = await asyncFunction(a)
const c = await asyncFunction(b)
const d = await asyncFunction(c)
console.log(d);
})()
function asyncFunction(x, fn){
return new Promise(function (resolve, reject) {
@reoxb
reoxb / index.html
Created May 23, 2018 16:46
Example templates // source https://jsbin.com/hugotun
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example templates</title>
</head>
<body>
<div id="app" v-cloak>
@reoxb
reoxb / index file export code
Last active October 29, 2020 18:49
Javascript
export { default } from './fileToExport';
export { default as NewNameToCachOnCurlyBraces } from './fileToExport';
import { NewNameToCachOnCurlyBraces } from './fileToImport'
another way
export * from './module';
module index file