Skip to content

Instantly share code, notes, and snippets.

View amancioandre's full-sized avatar
📈
It's Data Science time baby!

Andre Moraes amancioandre

📈
It's Data Science time baby!
View GitHub Profile
@amancioandre
amancioandre / README-Template.md
Created December 13, 2018 13:20 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@amancioandre
amancioandre / Usefull_Commands.md
Last active February 10, 2020 17:40
Usefull Commands

Usefull Commands

SSH

Add a RSA Id, ssh Key

$ ssh-add -k ~/.ssh/id_rsa

Show your public RSA Id, ssh

$ cat ~/.ssh/id_rsa.pub
@amancioandre
amancioandre / aliases.md
Last active March 14, 2020 00:58
SSH Aliases and Peaceful Connection

SSH ALIASES AND PEACEFUL CONNECTION

If you want a smooth ride on the cloud paradise you should leave your keys in the secret stash! Well, jokes aside, it seems we will be coming back and forth to our EC2 instances and, following good examples from @atgmello and @gabfr, I've come up with a simple step-by-step procedure to easy the journey whenever we want to rapidly connect to our instances.

After you set up your permissions with:

chmod 400 <your-pem-path>
@amancioandre
amancioandre / captain-definition
Created March 26, 2020 15:50
Flask API Captain Definition
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}
FROM python:3.7-alpine
WORKDIR /app
RUN apk update && apk upgrade
RUN apk add --no-cache make g++ bash git openssh postgresql-dev curl
RUN apk add --no-cache jpeg-dev zlib-dev
RUN apk add --no-cache gcc libc-dev fortify-headers linux-headers libxslt-dev
ENV PYTHONDONTWRITEBYTECODE 1
@amancioandre
amancioandre / audit_mixin.py
Created April 18, 2020 01:02 — forked from techniq/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
@amancioandre
amancioandre / gist:5ca0ae905c7443f7ded356e8c949738c
Created April 29, 2020 23:46 — forked from skyuplam/gist:ffb1b5f12d7ad787f6e4
Flask-Security and Flask-Admin example by Steve Saporata
# Example of combining Flask-Security and Flask-Admin.
# by Steve Saporta
# April 15, 2014
#
# Uses Flask-Security to control access to the application, with "admin" and "end-user" roles.
# Uses Flask-Admin to provide an admin UI for the lists of users and roles.
# SQLAlchemy ORM, Flask-Mail and WTForms are used in supporting roles, as well.
from flask import Flask, render_template
from flask.ext.sqlalchemy import SQLAlchemy
const first = new Promise((resolve, reject) => setTimeout(resolve, 5000));
const second = new Promise((resolve, reject) => setTimeout(reject, 5000));
Promise.allSettled([first, second]).then(myPromises => console.log(myPromises));
/*
[
{ status: 'fulfilled', value: undefined },
{ status: 'rejected', value: undefined },
]
@amancioandre
amancioandre / .gitignore
Created May 15, 2020 17:03
Machine Learning Engineering .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@amancioandre
amancioandre / requirements.txt
Last active June 3, 2020 20:16
Python Private Package Distribution
## Basic Instructions
# -------------------
# A package is on an open repository, follow the bellow example:
# Where:
# vcs = the provider [git+, hg+, svn+, bzr+]
# protocol = https or ssh
# egg = project name
# subdirectory = address to setup.py from the project root
-e vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir