Skip to content

Instantly share code, notes, and snippets.

View viniciusstroher's full-sized avatar

Vinicius Ferreira Stroher viniciusstroher

View GitHub Profile

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@viniciusstroher
viniciusstroher / python3_https_server.py
Created January 19, 2022 03:59 — forked from stephenbradshaw/python3_https_server.py
Python 3 Simple HTTPS server
#!/usr/bin/env python3
# python3 update of https://gist.github.com/dergachev/7028596
# Create a basic certificate using openssl:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# Or to set CN, SAN and/or create a cert signed by your own root CA: https://thegreycorner.com/pentesting_stuff/writeups/selfsignedcert.html
import http.server
import ssl
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler)
@viniciusstroher
viniciusstroher / apns.sh
Created August 1, 2021 03:52 — forked from greencoder/apns.sh
Curl the APNS http/2 API
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
@viniciusstroher
viniciusstroher / troubleshooting.md
Created July 28, 2021 17:02 — forked from cmawhorter/troubleshooting.md
Solution to AWS Lambda node.js UnrecognizedClientException "The security token included in the request is invalid."

Troubleshooting AWS unauthorized errors in lambda requests

This is mainly for node.js but might apply to other environments. Unsure.

If you are running a AWS Lambda function that calls another AWS service and getting an error about invalid tokens or other access denied errors, do this:

Check IAM

The role assigned to your lambda function will need permission to perform the actions. Check IAM and make sure the role has all the permissions.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@viniciusstroher
viniciusstroher / license.txt
Created January 20, 2021 01:51 — forked from codebrainz/license.txt
MJPEG Player in JavaScript
Copyright 2015 Matthew Brush
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@viniciusstroher
viniciusstroher / install.md
Created November 17, 2020 12:08 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@viniciusstroher
viniciusstroher / README.md
Created November 17, 2020 01:00 — forked from crypticmind/README.md
Setup lambda + API Gateway using localstack
@viniciusstroher
viniciusstroher / ddd.md
Created October 9, 2020 14:09 — forked from danilobatistaqueiroz/ddd.md
DDD - Domain Driven Design

DDD é um conjunto de boas práticas de orientação a objetos e um padrão de modelagem de sistemas, uma metodologia para aplicação de conceitos e padrões no projeto.

DDD tende a ser uma idéia geral focando em entender primeiro o domínio.
Os problemas em questão, os objetos com os quais está trabalhando.
São construídos os modelos primeiro, ferramentas para manipulá-los em segundo lugar, e depois a lógica de negócios no topo para resolver os problemas de domínio por exigência de negócios.
Normalmente trabalha em mecanismos de persistência em seguida, e apresentação por último.

Isso vem em contrapartida com o uso comum do Data-Driven Design ou Projeto Orientado a Dados, que a maioria dos desenvolvedores usa sem mesmo ter consciência disso. Devemos em um primeiro momento esquecer de como os dados são persistidos e nos preocupar mais em como representar melhor as necessidades de negócio em classes e comportamentos.

@viniciusstroher
viniciusstroher / automigrate.js
Created September 3, 2020 01:46
[LB4] Loopback 4 Automigrate Example (example/todo-list)
// Place in app root, build project (e.g: 'npm start'), execute (e.g. 'node automigrate.js')
const {DbDataSource} = require('./dist/src/datasources/db.datasource.js');
const {TodoRepository} = require('./dist/src/repositories/todo.repository.js');
const {TodoListRepository} = require('./dist/src/repositories/todo-list.repository.js');
const db = new DbDataSource();
const repoTodo = new TodoRepository(db);
const repoTodoList = new TodoListRepository(db);