Skip to content

Instantly share code, notes, and snippets.

View testillano's full-sized avatar

Eduardo Ramos Testillano testillano

View GitHub Profile
@testillano
testillano / cost_ipynb
Last active October 26, 2024 18:56
Download and plot Spanish Regulated Market daily reports
%config InlineBackend.figure_format = 'svg' # para mejorar la calidad visual de las gráficas...
import pandas as pd
import matplotlib.pyplot as plt
from urllib.error import HTTPError
import time
from datetime import datetime
#from IPython.display import display
# Calculo de area bajo curva de coste unitario (finalmente multiplicaremos por los KWh, por ejemplo 10A => 2300W => 4,6KWh en 2 horas
import numpy as np
@testillano
testillano / docker-compose.yml
Last active April 16, 2024 12:45
http2 load balancer using docker-compose
version: '3'
services:
h2a:
image: ghcr.io/testillano/h2agent_http1:4.2.5
hostname: h2a
#expose:
# - "8001"
ports:
# Ephemeral (use 'docker-compose ps' to see them)
@testillano
testillano / safe-file.cc
Last active July 18, 2022 07:10
SafeFile with close delayed and max files opened control
///////////////////////////////////////////////////////////////
// Safe file: allow safe writting of text/binary files.
// Close delay configurable.
// Max opened files controlled by condition variable.
//
// LINK: g++ main.cc -l pthread -l boost_system -l boost_thread
///////////////////////////////////////////////////////////////
#include <iostream>
#include <thread>
#include <vector>
#include <iterator>
#include <iostream>
#include <sstream>
#include <string>
#include <string.h>
#include <memory>
#include <sys/time.h>
const int maxChunkSize = 32000;
@testillano
testillano / asio-sv3-without-queue.cc
Last active June 30, 2022 00:10
asio-sv3 simplified (without Queue for worker threads)
#include <iostream>
#include <string>
#include <mutex>
#include <thread>
#include <future>
#include <deque>
#include <nghttp2/asio_http2_server.h>
using namespace nghttp2::asio_http2;
#include <iostream>
#include <string>
#include <mutex>
#include <thread>
#include <future>
#include <deque>
#include <memory>
#include <sstream>
#include <nghttp2/asio_http2_server.h>