Skip to content

Instantly share code, notes, and snippets.

View filipemansano's full-sized avatar

Filipe Mansano filipemansano

View GitHub Profile
@filipemansano
filipemansano / Dockerfile
Created January 15, 2024 05:56
dockerfile para criar um layer com opencv+numpy para lambda aws
# https://gallery.ecr.aws/lambda/python
FROM public.ecr.aws/lambda/python:3.11-x86_64
RUN yum install zip -y
RUN python3.11 -m venv /var/venv
ENV PATH="/var/venv/bin:$PATH"
RUN pip install numpy opencv-python-headless
RUN mkdir -p /var/layer/python/lib/python3.11/site-packages
@filipemansano
filipemansano / README
Last active July 8, 2023 08:27
configure flask with apache + vhost
#####################################
install module wsgi on apache2 (https://pypi.org/project/mod-wsgi/)
####################################
(Install apache develop package)
apt-get install apache2-dev
(install mod_wsgi)
python3 -m pip install mod_wsgi
Step 1: Commit all your pending changes in the repo which you want to fix and push that.
Step 2: Now you need to remove everything from the git index in order to refresh your git repository. This is safe. Use this command:
git rm -r --cached .
Step 3: Now you need to add everything back into the repo, which can be done using this command:
git add .
Step 4: Finally you need to commit these changes, using this command:
@filipemansano
filipemansano / script.sql
Created July 20, 2020 22:13
generate script to convert all tables to the same collation
SELECT CONCAT("ALTER TABLE `", TABLE_SCHEMA, '`.`', TABLE_NAME,"` COLLATE utf8mb4_0900_ai_ci;") AS ExecuteTheString
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA="[DATABASENAME]"
AND TABLE_TYPE="BASE TABLE";
@filipemansano
filipemansano / kill-er.sh
Created April 29, 2020 18:49
mata todos processo usando regex
kill $(ps aux | grep 'string contem no processo' | awk '{print $2}')
@filipemansano
filipemansano / command.txt
Last active April 15, 2020 13:50 — forked from fbn4sc/command.txt
Delete all branches except master, QA and development.
git branch | grep -v "master\|development|qa" | xargs git branch -D
@filipemansano
filipemansano / index.php
Last active December 5, 2018 16:52
Exemplo de envio de arquivo com jQuery e PHP
<?php
if(isset($_FILES) && count($_FILES) > 0){
print_r($_FILES);
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
@filipemansano
filipemansano / getcep.html
Created November 17, 2018 04:24
Exemplo básico de consulta de CEP consumindo uma API em jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Pesquisa CEP</title>
</head>
<body>
@filipemansano
filipemansano / jwt.interceptor.ts
Last active April 17, 2024 17:44
Interceptador HTTP em Angular 6 para adicionar o Token JWT nos request, e renovar o token caso expirado funcionando com múltiplas chamadas
import {throwError as observableThrowError, Observable , BehaviorSubject } from 'rxjs';
import { Injectable, Injector } from '@angular/core';
import {
HttpInterceptor,
HttpRequest,
HttpHandler,
HttpEvent
} from '@angular/common/http';
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { CrudInterface } from "@app/core/crud.interface";
import { environment } from "@env/environment";
import { Observable } from "rxjs/Observable";
@Injectable()
export class CRUD<T> implements CrudInterface<T>{
endpoint: string;