Skip to content

Instantly share code, notes, and snippets.

View marquicus's full-sized avatar
:octocat:

Marco A Rojas marquicus

:octocat:
View GitHub Profile
@marquicus
marquicus / README.md
Created July 31, 2021 13:23 — forked from mattupstate/README.md
An example of how to setup streaming replication for PostgreSQL with Docker.

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave:

@marquicus
marquicus / formula.py
Created March 15, 2021 15:23 — forked from gvx/formula.py
Propositional logic library for Python 3, that can valuate an expression and check whether it is a tautology
"""
formula.py - propositional formulas for Python
by Robin Wellner
Hereby, I waive all rights to this library, as described at <http://creativecommons.org/publicdomain/zero/1.0/>
Examples:
foo = Atom('foo')
bar = Atom('bar')
import argparse
import pandas as pd
def gas_prices(input, filetype="csv"):
"""Getting gas prices by day and month
1. Read csv or excel (assuming extension csv is a true csv file format, it might be another validations in real scenario)
1.1 Datetime Index is for month
2. Write to csv
@marquicus
marquicus / Challenge 1
Created January 23, 2020 00:06
Task: write a script to get a nice CSV file of natural gas prices.
# 1. Main data wanted is daily prices. (I downloaded the Henry_Hub_Natural_Gas_Spot_Price.csv with view history as daily)
import pandas as pd
dfg = pd.read_csv('Henry_Hub_Natural_Gas_Spot_Price.csv', skiprows=4)
dfg.index = pd.to_datetime(dfg["Day"],format='%m/%d/%Y')
dfg.to_csv('gas_byday.csv', index=False) # => first output gas_byday.csv file
# 1.1 Bonus points for doing other granularities (e.g. month) - do them in separate CSV files with sensible naming Resulting CSV should have two columns: Date and Price. You may need to normalize the data to get this and/or work out dates. For months the Date should be the first date of the month.
@marquicus
marquicus / env.sh
Created September 14, 2019 13:17
Herramienta de gestión de proyectos para python django en cumplimiento con12factor.net
#!/bin/bash
#
##
## Vendor: Zentek ST
##
DIRNAME=$(dirname $0)
APPMAIL="[email protected]"
APPVERSION="2.0"