Skip to content

Instantly share code, notes, and snippets.

View AlexGalhardo's full-sized avatar
😀
Remember: Always Have Fun

Alex Galhardo AlexGalhardo

😀
Remember: Always Have Fun
View GitHub Profile
@AlexGalhardo
AlexGalhardo / 2019-https-localhost.md
Created July 22, 2021 14:14 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@AlexGalhardo
AlexGalhardo / emailmask.js
Created July 17, 2021 15:50 — forked from gabrielfroes/emailmask.js
Javascript Email Mask
/*
Create a Mask in an email address
This function create a mask using a valid email address.
This is usefull when someone need to confirm the email used in a system
Author: Gabriel Froes - https://gist.github.com/gabrielfroes
*/
function emailMask(email) {
var maskedEmail = email.replace(/([^@\.])/g, "*").split('');
var previous = "";
for(i=0;i<maskedEmail.length;i++){
@AlexGalhardo
AlexGalhardo / slugify.js
Created July 17, 2021 15:50 — forked from gabrielfroes/slugify.js
Javascript Slugify
/*
Create SLUG from a string
This function rewrite the string prototype and also
replace latin and other special characters.
Forked by Gabriel Froes - https://gist.github.com/gabrielfroes
Original Author: Mathew Byrne - https://gist.github.com/mathewbyrne/1280286
*/
if (!String.prototype.slugify) {
String.prototype.slugify = function () {
@AlexGalhardo
AlexGalhardo / Dockerfile
Created July 17, 2021 15:47 — forked from gabrielfroes/Dockerfile
Docker + VS Code #CDFTV #MaoNoCodigo3
FROM php:7.2-apache
RUN docker-php-ext-install mysqli
RUN a2enmod rewrite
@AlexGalhardo
AlexGalhardo / ler-emails.php
Created March 11, 2021 14:58 — forked from CViniciusSDias/ler-emails.php
Script para ler e-mails em voz alta usando PHP
<?php
use PhpImap\Mailbox;
require_once 'vendor/autoload.php';
$mailbox = new Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX',
'[email protected]',
'sua senha aqui',
/**
* Script simples para importação de dados de cotação da Bovespa
*
* Requisitos:
* - Node.js instalado
* - instalar as dependencias: npm install extract-zip moment request
*
* Exemplo de uso: node script_simples_importaca_cota_hist_bovespa.js 05022019
*
* Post relacionado: https://albertosouza.net/artigos/22-importando-dados-bovespa
@AlexGalhardo
AlexGalhardo / jwt_decode.php
Created May 18, 2020 13:06 — forked from ahgood/jwt_decode.php
Get payload data from JWT token.
<?php
/**
* JSON Web Token implementation
*
* Minimum implementation used by Realtime auth, based on this spec:
* http://self-issued.info/docs/draft-jones-json-web-token-01.html.
*
* @author Neuman Vong <[email protected]>
*/
class JWT

MySQL Structure

Numeric types:

Data Type Explanation
@AlexGalhardo
AlexGalhardo / git-clearHistory
Created May 7, 2020 16:12 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
<?php
// Exit the file, string inside get's echo'ed
die("This file is not ment to be ran. ¯\_(ツ)_/¯");
exit("This file is not ment to be ran. ¯\_(ツ)_/¯");
/**
* Printing
*/
echo ""; // Print a string or type that can be made into a string(I.E int, float).