Skip to content

Instantly share code, notes, and snippets.

View amancioandre's full-sized avatar
🤠
Life is what happens outdoors!

André Amnc amancioandre

🤠
Life is what happens outdoors!
View GitHub Profile
@amancioandre
amancioandre / setup.py
Created June 3, 2020 20:17
Python setup.py for package distribution
import io
import os
from pathlib import Path
from setuptools import find_packages, setup
from setuptools.command.install import install
from subprocess import call
# Package meta-data
NAME = 'your package name'
@amancioandre
amancioandre / send_data.py
Created June 5, 2020 17:07
Sending data to API from Pandas
import requests
import time
import pandas as pd
from json import dumps
headers = {
'Content-Type': 'application/json',
'Api-Key': 'api key here'
}
@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 / MatchmakingConfiguration.md
Last active September 14, 2020 19:29
AWS GameLift StartMatchmaking
@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 / encryption.js
Created April 29, 2021 12:34 — forked from vlucas/encryption.ts
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 / 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 / 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 / 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}"
FROM python:3.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY . /code/
RUN pip install -r requirements-dev.txt