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
| #!/bin/bash | |
| # Configuration variables | |
| DB_HOST="localhost" # Database host | |
| DB_PORT="5432" # Database port | |
| DB_NAME="database_name" # Database name | |
| DB_USER="db_user" # Database user | |
| DB_PASSWORD="" # Database password (leave empty if using .pgpass) | |
| TABLE_NAME='"table_name"' # Table to export | |
| OUTPUT_FILE="table_export_$(date +%Y%m%d).sql" # Output file with dynamic date |
- Crear un nuevo repositorio en GitHub
- Clonar el repositorio en la máquina local
- Añadir el submodule, donde
repository_urles la url del repositorio ydirectory_namees el nombre de la carpeta donde quieres que se guarde el sub-módulo (no debe de existir en el proyecto)
git submodule add <repository_url> <directory_name>
- Añadir los cambios al repositorio (git add, git commit, git push)
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
| import random | |
| import csv | |
| from datetime import timedelta | |
| def load_circles(filename): | |
| with open(filename, 'r') as csvfile: | |
| reader = csv.reader(csvfile) | |
| rows = list(reader)[1:] | |
| for row in rows: | |
| c = Circle.objects.create( |
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
| #region Help: Introduction to the script task | |
| /* The Script Task allows you to perform virtually any operation that can be accomplished in | |
| * a .Net application within the context of an Integration Services control flow. | |
| * | |
| * Expand the other regions which have "Help" prefixes for examples of specific ways to use | |
| * Integration Services features within this script task. */ | |
| #endregion | |
| #region Namespaces |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Coinbase Demo</title> | |
| </head> | |
| <body> | |
| <button id="btn">Comprar cn Criptomonedas</button> |
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
| exports.webhookHandler = functions.https.onRequest(async (req, res) => { | |
| const rawBody = req.rawBody; | |
| const signature = req.headers['x-cc-webhook-signature']; | |
| const webhookSecret = 'your webhook'; | |
| try { | |
| const event = Webhook.verifyEventBody(rawBody, signature, webhookSecret); | |
| if (event.type === 'charge:pending') { | |
| // TODO |
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
| exports.createCharge = functions.https.onRequest((req, res) => { | |
| cors(req, res, async () => { | |
| // TODO get real product data from database | |
| const chargeData = { | |
| name: 'Widget', | |
| description: 'Usando una pasarela de prueba', | |
| local_price: { | |
| amount: 9.99, | |
| currency: 'USD', |
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
| const functions = require('firebase-functions'); | |
| const cors = require('cors')({ origin: '*' }); | |
| const { Client, Webhook, resources } = require('coinbase-commerce-node'); | |
| const coinbaseSecret = 'your-api-key'; | |
| const signingSecret = 'your-webhook-secret'; | |
| Client.init(coinbaseSecret); | |
| const { Charge } = resources; |
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
| Stream.fromIterable([1, 2, 3]); | |
| Stream.value(10); | |
| Stream.empty(); | |
| Stream.error(Exception('ups! algo salio mal')); | |
| Stream.fromFuture(Future.delayed(Duration(seconds: 1), () => 42)); | |
| Stream.periodic(Duration(seconds: 1), (index) => index); |
NewerOlder