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

73# First steps after installing Pop!_OS 19.10

Using ansible. Installs pyenv, nvm, keybase, keeweb, vs codium, riot-web, golang

Packages

Upgrade & install basics

sudo apt-get update && sudo apt-get upgrade -y
@amancioandre
amancioandre / .gitconfig
Created January 31, 2022 05:09 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
@amancioandre
amancioandre / verify-ses-email.sh
Created May 29, 2021 18:37 — forked from dvejmz/verify-ses-email.sh
Auto-verify SES email address upon launching localstack
#!/bin/bash
set -eo pipefail
## Mount this file in /docker-entrypoint-initaws.d so that localstack runs it
## as part of its entrypoint routine.
echo 'Running AWS verify identity command. See: https://github.com/localstack/localstack/issues/339'
aws ses verify-email-identity --email-address ${EMAIL_ADDRESS} --region ${AWS_REGION} --endpoint-url=http://localhost:4579
echo "Verified ${EMAIL_ADDRESS}"
@amancioandre
amancioandre / startCodeBuild.sh
Created May 18, 2021 14:02 — forked from yardbirdsax/startCodeBuild.sh
Start AWS Codebuild pipeline from command prompt and wait
#!/bin/bash
error_exit()
{
echo "$1" 1>&2
exit 1
}
CODEBUILD_PROJECT_NAME=$1
@amancioandre
amancioandre / class_decorator.ts
Created May 9, 2021 02:02 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@amancioandre
amancioandre / encryption.js
Created April 29, 2021 12:34 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@amancioandre
amancioandre / customize-mx-master-ubuntu.md
Created November 9, 2020 14:21 — forked from bogdanRada/customize-mx-master-ubuntu.md
Custom keymap for Logitech MX Master 2S mouse on Ubuntu

First, install Solaar to see the battery level on the taskbar

sudo apt-get install solaar

To remap the keys, install

sudo apt-get install xbindkeys xautomation
@amancioandre
amancioandre / .gitignore
Created June 10, 2020 18:47 — forked from GhostofGoes/.gitignore
Basic .gitignore template for Python projects
# Editors
.vscode/
.idea/
# Vagrant
.vagrant/
# Mac/OSX
.DS_Store
@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
@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)