Skip to content

Instantly share code, notes, and snippets.

View realFranco's full-sized avatar
🚀
On a Rocket

Franco Gil realFranco

🚀
On a Rocket
View GitHub Profile
@realFranco
realFranco / sqliclient.py
Last active February 12, 2020 18:48
python's SQLite client.
"""
SQL client to create or consuting a DB.
Dev: Franco Gil.
"""
import os
import json
from time import gmtime, strftime
@realFranco
realFranco / dynamo_client.py
Created January 17, 2020 13:56
python - AWS DynamoDB Client
"""
Dev: Franco Gil.
DynamoDB Documentation:
boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb
docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html
** The Front End are check the Optional & Non - Optional data requeriments. **
"""
@realFranco
realFranco / dual_pivot_quick_sort.c
Created January 17, 2020 14:57
Dual Pivot Quick Sort - Yarovlavskiy Algorithim implementation.
/*
Code Name: dual_pivot.c
Developer: franco Gil
Date: 18*2*17
Edited: 1*12*18
Concept: Dual pivot Quicksort. (Yarovlavskiy)
---------------------------------------------------------------------
Compilation way # 1:
@realFranco
realFranco / insertion_l.c
Created January 17, 2020 14:59
Insertion Sort - Implelemented using Linked Lists.
/*
* insercion.l.c
* franco Gil
* date: 23*3*17
* Insertion sort algorithm, using dynamic memory, and
* self NODES for construct a simple linked LIST.
*/
#include <stdio.h>
#include <stdlib.h>
@realFranco
realFranco / trigger_slug_creator.sql
Created May 12, 2020 04:19
Trigger Before Insertion.
-- Date: May 12, 2020
--
-- RDBMS: Postgres.
-- Procedural Language: PL / pgSQL.
-- Given two params. create a slug (url identification) as new attr. for a row.
--
-- Input: (a, a)
-- Output: 'a-a', if the tuple (a, a) do not exist.
--
-- if the tuple exist (a, a), then
@realFranco
realFranco / fibonacci.sql
Last active May 13, 2021 21:35
Using Procedural Language PostgreSQL for a Fibonacci number implementation.
-- Trying a fibonacci on pl/pgsql
create or replace function fibonacci( step integer )
returns integer as
$$
begin
-- raise info 'step %', step;
if step = 0 then
return 0;
else
@realFranco
realFranco / ses_sns_lambda_dynamodb.js
Last active February 22, 2021 20:00
Code for a Lambda function. Send data into Dynamodb.
/**
* Date: June 16th, 2020
* Dev: [email protected]
*
* > Code triggered by the lambda function to continue with SES Stats.
* > Including the original email headers on delivery notifications.
*
* Code taken from:
* > https://aws.amazon.com/premiumsupport/knowledge-center/lambda-sns-ses-dynamodb/
*
@realFranco
realFranco / deploy_ssl_nginx_react_yarn.sh
Last active December 29, 2020 20:29
Recipe to deploy an React app using the environment: ubuntu, nginx, node, npm2
# Steps to install the react Project
# Requirements:
# - ubuntu 18.04 ( I do not test it on 20.04 ).
# - git
# - Nginx
# - Node
# - pm2
# - Certbot
# References
# https://majornetwork.net/2020/10/webhook-listener-with-fastapi/
# https://majornetwork.net/2020/11/systemd-setup-for-fastapi-webhook-listener/
git clone https://gitlab.com/realFranco/some-rest-service.git
cd into_the_folder
nano .env
sudo apt-get install python3-venv
python3 -m venv env
source env/bin/activate
{
"service_type" : [
{ "code" : "0108000", "description" : "Teleconsulta"},
{ "code" : "0101c01", "description" : "Visita Médica Presencial" },
{ "code" : "0101c02", "description" : "Atención Presencial" },
{ "code" : "0307c01", "description" : "Toma de Muestra Lab" },
{ "code" : "0108c01", "description" : "Atención de Teleconsulta" },
{ "code" : "0307c02", "description" : "Toma de Muestra PCR" },
{ "code" : "2601000", "description" : "Procedemiento de Enfermería" },
{ "code" : "2601c01", "description" : "Vacunación" }