Skip to content

Instantly share code, notes, and snippets.

View mendesalexandre's full-sized avatar

Alexandre Teixeira Mendes mendesalexandre

  • Sinop, Mato Grosso, Brasil
View GitHub Profile
@mendesalexandre
mendesalexandre / cert.php
Created July 22, 2025 00:42 — forked from jpdroid/cert.php
assina um pdf com cert digital a1
<?php
require_once('vendor/autoload.php');
use setasign\Fpdi\Tcpdf\Fpdi;
Class PDF extends FPDI{
private $nome;
private $cpf;

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@mendesalexandre
mendesalexandre / README.md
Created January 18, 2025 20:51 — forked from adammacias/README.md
+250 comandos para usar a Alexa em Português

Conhecendo a Alexa

  1. Alexa, quais são suas habilidades mais populares?
  2. Alexa, quais são suas habilidades com jogos?
  3. Alexa, quais são suas habilidades domésticas inteligentes?
  4. Alexa, que coisas posso experimentar?

Passatempos e datas

  1. Alexa, faz um beatbox
  2. Alexa, faz uma batida de funk
  3. Alexa, cante uma música
@mendesalexandre
mendesalexandre / mount_cifs.sh
Created December 5, 2024 16:00 — forked from ParkWardRR/mount_cifs.sh
This script helps to mount a CIFS network share on Ubuntu/Mint/Debian OS
#!/bin/bash
# Description:
# This script helps to mount a CIFS network share on Ubuntu/Mint/Debian OS
# Attempt to mount a network share using cifs protocol.
# Takes a server share address and target mount point as input, and writes the values to /etc/fstab
# Update the .smbcredentials file with CIFS username and password
# Template for .smbcredentials:
@mendesalexandre
mendesalexandre / in_arrayi.php
Created December 4, 2024 18:41 — forked from babeuloula/in_arrayi.php
PHP: Case-insensitive in_array()
<?php
/**
* Case-insensitive in_array() wrapper.
*
* @param mixed $needle Value to seek.
* @param array $haystack Array to seek in.
* @param bool $strict If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack.
*
* @return bool
@mendesalexandre
mendesalexandre / replace_html_tags.php
Created November 14, 2024 01:30 — forked from herveguetin/replace_html_tags.php
Replace HTML tags using PHP DOM objects and Zend_Dom_Query
<?php
$replacedTags = array(
'dt' => array( // <dt> tag is replaced by...
'tag' => 'div', // ... <div> tag...
'attributes' => array( // ... with these attributes
'class' => 'some-class',
'id' => 'some_id',
'data-something' => 'some-value'
)
),
@mendesalexandre
mendesalexandre / isCNPJ.php
Created October 29, 2024 23:30 — forked from brunoconstantino/isCNPJ.php
Validador de CNPJ alfa-numérico em PHP
<?php
/**
* Valida um CNPJ com 14 caracteres, onde os 12 primeiros podem ser alfanuméricos e os 2 últimos são dígitos verificadores.
* A validação é feita utilizando o método do módulo 11, e para caracteres alfabéticos o valor ASCII é subtraído por 48.
*
* @link http://normas.receita.fazenda.gov.br/sijut2consulta/link.action?idAto=141102
* @param string $cnpj O CNPJ a ser validado, com 14 caracteres alfanuméricos (12 primeiros) e numéricos (2 últimos).
* @return bool Retorna true se o CNPJ for válido, false caso contrário.
* @author Bruno Constantino
* @date 2024-10-29
#!/bin/bash
## Install Debian/Ubuntu
## https://think.unblog.ch/en/multiple-php-fpm-versions-with-apache-on-debian-12/
## https://tecadmin.net/how-to-install-php-on-debian-11/
## https://shape.host/resources/how-to-install-multiple-versions-of-php-on-debian-with-ispconfig
apt install -y lsb-release apt-transport-https ca-certificates wget gnupg
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
<?php
/**
* @author Tiarê Balbi
* @package PagSeguro
* @category osCommerce, Loja Virtual, Pagamentos
*/
class Pagseguro {
/**
@mendesalexandre
mendesalexandre / 0- install nodejs and redis.sh
Created October 12, 2024 14:09 — forked from moaalaa/0- install nodejs and redis.sh
How to run PM2 with laravel queue and laravel echo server
# Node Js
# Centos7
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum install nodejs
# Ubuntu 20.04
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt install nodejs