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
I am attesting that this GitHub handle jobsamuel is linked to the Tezos account tz1c1ujBjmQDrq4nxKVrG3ibnPyZ1CUMU5Pn for tzprofiles | |
sig:edsigtzDR7R6mYea3nv8HsVt2vaTrwuL8KmFAqZnNMjeALhW8mqDeabAtVtt5rP5PTgFUfeCrf9fbqguP3FM2mrnvFbCYWiU8x6 |
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
# Go to "Activate Google Cloud Shell" in https://console.cloud.google.com/home. | |
echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json | |
# If you want to restrict the access one or more specific domains, add their URL to the array: | |
echo '[{"origin": ["https://yourdomain.com"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json | |
# Set CORS config. | |
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME | |
# Verify if everything is OK. |
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 quitarAcentos(texto) { | |
const x = 'abcdefghijklmnopqrstvuwxyz'; | |
const y = 'ábćdéfǵhíjḱĺḿńóṕqŕśtúǘẃxýź'; | |
const z = new RegExp(`[${y}]`, 'g'); | |
return texto.toLowerCase() | |
.replace(z, letra => x[y.indexOf(letra)]); | |
} |
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
# Git commits style | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
alias commit="echo ' | |
${bold}<acción>(<ámbito>): <descripción>${normal} | |
• ${bold}${underline}acción:${normal} razón del commit. Debe ser una de estas: | |
${bold}feat:${normal} Implementación de nueva funcionalidad. |
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
Verifying my Blockstack ID is secured with the address 1C8RqxQgwfRC4W5g7SePdRYoMcgnwb9FTf https://explorer.blockstack.org/address/1C8RqxQgwfRC4W5g7SePdRYoMcgnwb9FTf |
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
Verifying my Blockstack ID is secured with the address 1GyQPFfVkMxe8Y2k3eHax8aMS4KUNDcibn https://explorer.blockstack.org/address/1GyQPFfVkMxe8Y2k3eHax8aMS4KUNDcibn |
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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
// Aquí ocurre la magia de las variables de entorno: | |
const token = functions.config().variable.key; | |
exports.ejemploVariableDeEntorno = functions.https.onRequest((req, res) => { | |
if (req.method === 'GET') { | |
res.send(`Tu variable de entorno es ${token}`); | |
} else { |
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
# Puede tardar un poco en responder, no desesperes ;) | |
firebase functions:config:get | |
# La respuesta debería ser así: | |
{ | |
"variable": { | |
"key": "ab1cde234def567890abcde12345f", | |
"id": "VARIABLE" | |
} | |
} |
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
# Un ejemplo genérico. | |
firebase functions:config:set variable.key="ab1cde234def567890abcde12345f" variable.id="VARIABLE" | |
# Un ejemplo no tan genérico. | |
firebase functions:config:set bitly.key="ab1cde234def567890abcde12345f" bitly.id="BITLY" | |
# Otro ejemplo no tan genérico. Noten como el parámetro 'id' puede ser diferente. | |
firebase functions:config:set instagram.key="ab1cde234def567890abcde12345f" instagram.id="IG_TOKEN" |
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
window.addEventListener('scroll', () => { | |
if (window.scrollY === document.body.scrollHeight - window.innerHeight) { | |
// Do something | |
} | |
} | |
NewerOlder