Skip to content

Instantly share code, notes, and snippets.

View despossivel's full-sized avatar
💡

Matheus Brito despossivel

💡
View GitHub Profile
@despossivel
despossivel / rsa_util.go
Created December 4, 2022 18:27 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
version: '2.3'
services:
app:
build: .
container_name: app
volumes:
- ./laravel:/var/www
networks:
- app-network
@despossivel
despossivel / gist:0be245f5de3329e660fcc5b26536b138
Created April 9, 2020 01:18 — forked from willnss/gist:3246637
Gerador de CPF, NIT, CNPJ e CEI válidos
<html>
<head>
<title>Gerador de CPF, CNPJ e NIT Válidos</title>
<script language="javascript">
function gera_random(n) {
var ranNum = Math.round(Math.random()*n);
return ranNum;
}
function mod(dividendo,divisor) {
@despossivel
despossivel / default nginx configuration file
Created February 22, 2020 20:38 — forked from skbr1234/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@despossivel
despossivel / Error-Handling-Patterns-Express.md
Created February 21, 2020 17:34 — forked from zcaceres/Error-Handling-Patterns-Express.md
error handling patterns in Express

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

sudo apt-get install libgd2-xpm-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal20 libgeos-c1v5 libmapserver2 cgi-mapserver mapserver-bin
sudo apt-get install spawn-fcgi
crie o arquivo
/etc/init.d/mapserv
com o conteudo
db.pedidos.find({ produtos:{ $elemMatch:{"_idEstabelecimento" : ObjectId("5d656c23cf165a77edaa1927")} } }).pretty()
db.pedidos.find({ $or:[{status:0}], $and:[{ produtos:{ $elemMatch:{"_idEstabelecimento" : ObjectId("5d656c23cf165a77edaa1927")} } } ] }).pretty()
@media (min-width:1px) and (max-width: 329px)
{
}
@media (max-width: 479px) and (min-width: 330px)
{
}
@media (min-width:480px) and (max-width: 692px)
{