Skip to content

Instantly share code, notes, and snippets.

View rolangom's full-sized avatar
💭
John 3:16

Rolando Gómez Tabar rolangom

💭
John 3:16
View GitHub Profile
@rolangom
rolangom / quicksort.py
Created March 4, 2023 12:55
Quick sort implementation in python using recursive calls and for comprehension
def quicksort(array):
if len(array) == 0:
return array
pivot = array[0]
rest = array[1:]
smallers = quicksort([x for x in rest if x < pivot])
biggers = quicksort([x for x in rest if x >= pivot])
@rolangom
rolangom / index.js
Created July 14, 2022 16:43
DGII Query handler using GCP and FP crocks library
// const crocks = require('crocks');
// const fs = require('fs');
const axios = require('axios');
const unzip = require('unzip');
const rimraf = require('rimraf');
const Async = require('crocks/Async');
const maybeToAsync = require('crocks/Async/maybeToAsync');
const { curry, prop, compose, safe } = require('crocks/helpers');
@rolangom
rolangom / plotly_dash_month_picker_range.py
Last active January 19, 2022 14:35
Plotly Dash Custom year month (yyyy-mm) picker range, using DateRangePickerInput styles.
import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
def build_month_picker_range(
from_date_id:str,
to_date_id:str,
from_date:str = '2015-01',
to_date:str = pd.Timestamp.now().strftime('%Y-%m'),
from_date_value:str = None,
@rolangom
rolangom / domincan.geojson
Last active November 18, 2021 15:55
Domincan Republic GeoJSON with ISO Code according to https://en.wikipedia.org/wiki/ISO_3166-2:DO#Provinces_and_district
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rolangom
rolangom / rx_fetch_ib_data.py
Created October 28, 2021 11:09
rx_fetch_ib_data
from ibapi.wrapper import EWrapper
from ibapi import utils
from ibapi.client import EClient, Contract
from ibapi.common import TickerId, BarData, TagValueList
from ibapi.utils import iswrapper
import rx
import rx.operators as rx_op
from rx.subject import AsyncSubject, Subject, BehaviorSubject, ReplaySubject
from rx.core.observable import Observable
import time
@rolangom
rolangom / vgsales.ipynb
Created October 20, 2021 21:20
video game sales analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rolangom
rolangom / GTFlowEngine.tsx
Last active November 11, 2021 21:15
GTFlowEngine
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
import createStore from "./GTState";
const DUMMY_FUNC = (...args: any[]) => {};
const RESIZER_SIZE = 10;
const PORT_RADIUS = 6;
const PADDING_RIGHT = 50;
const PORT_LABEL_FONT_SIZE = 7;
const portCircleWidth = 2;
const RESIZER_BORDER_WIDTH = 1;
@rolangom
rolangom / download_bars.py
Created August 8, 2021 23:27 — forked from wrighter/download_bars.py
A command line utility to download historical data from Interactive Brokers
#!/usr/bin/env python
import os
import sys
import argparse
import logging
from datetime import datetime, timedelta
from typing import List, Optional
from collections import defaultdict
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Sheet API Test"
@rolangom
rolangom / wevents.py
Last active October 15, 2020 12:52
Create Windows events using Python 3
"""
Create windows events
"""
import os
def create_event(srcname: str, type: str, id: int, description: str):
command = f'eventcreate /t {type} /id {id} /l application /so {srcname} /d "{description}"'
os.system(f'cmd /c "{command}"')
def post_info_event(srcname: str, id: int, description: str):