Skip to content

Instantly share code, notes, and snippets.

View devjaime's full-sized avatar
😉
My job is to make your experience the best

Jaime Hernández devjaime

😉
My job is to make your experience the best
View GitHub Profile
@devjaime
devjaime / postgresql_export.sh
Created March 19, 2025 11:39
Automatizando Exportaciones de PostgreSQL con Bash
#!/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
@devjaime
devjaime / instalaciones-database.md
Created March 17, 2025 16:26 — forked from Klerith/instalaciones-database.md
Instalaciones necesarias para el curso de base de datos
@devjaime
devjaime / README.md
Created July 15, 2024 22:23 — forked from Klerith/README.md
Pasos para configurar y crear sub-módulos en Git y Github

Pasos para crear los Git Submodules

  1. Crear un nuevo repositorio en GitHub
  2. Clonar el repositorio en la máquina local
  3. Añadir el submodule, donde repository_url es la url del repositorio y directory_name es 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>
  1. Añadir los cambios al repositorio (git add, git commit, git push)
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(
@devjaime
devjaime / scriptMain.cs
Created July 13, 2021 02:23
ETL SSIS upload file sftp
#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
@devjaime
devjaime / .js
Created April 2, 2021 15:57
index.js El código de la interfaz debe realizar una solicitud a la función de la nube para crear un cargo
<!DOCTYPE html>
<html lang="en">
<head>
<title>Coinbase Demo</title>
</head>
<body>
<button id="btn">Comprar cn Criptomonedas</button>
@devjaime
devjaime / .js
Created April 2, 2021 15:52
Cree otra función de nube HTTP para manejar webhooks.
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
@devjaime
devjaime / .js
Created April 2, 2021 15:33
index.js Crear un cargo
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',
@devjaime
devjaime / .js
Created April 2, 2021 15:27
index.js importa los paquetes requeridos
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;
@devjaime
devjaime / .dart
Created March 21, 2021 06:17
La clase Stream también viene con algunos constructores útiles. Éstos son los más comunes
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);