Skip to content

Instantly share code, notes, and snippets.

View miqueiaspenha's full-sized avatar
🏠
Working from home

Miqueias Penha miqueiaspenha

🏠
Working from home
  • Brasil
View GitHub Profile
@miqueiaspenha
miqueiaspenha / fonts.sh
Created November 8, 2023 18:21 — forked from incogbyte/fonts.sh
Install Meslo Fonts Ubuntu Linux Mint and debians
#!/bin/bash
sudo apt install fontconfig
cd ~
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
mkdir -p .local/share/fonts
unzip Meslo.zip -d .local/share/fonts
cd .local/share/fonts
rm *Windows*
cd ~
@miqueiaspenha
miqueiaspenha / mint_themes_ubuntu.md
Created November 7, 2023 15:15 — forked from 0lzi/mint_themes_ubuntu.md
Install Mint Themes and Icons on Ubuntu
# Install required packages
sudo apt-get install git make ruby-sass

# Keep all the stuff together
mkdir mint
cd mint

# Clone the repository
git clone https://github.com/linuxmint/mint-themes.git
@miqueiaspenha
miqueiaspenha / gist:2f42af00627bfc93902016cfc5aa9788
Created November 6, 2021 18:27 — forked from jmblog/gist:3222899
Simple HTML encoding/decoding using jQuery
// http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding
function htmlEncode(value){
return $('<div/>').text(value).html();
}
function htmlDecode(value){
return $('<div/>').html(value).text();
}
@miqueiaspenha
miqueiaspenha / ContextCmder-Disable.reg
Created February 11, 2021 21:24 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@miqueiaspenha
miqueiaspenha / ip_in_range.php
Created October 24, 2020 13:28 — forked from tott/ip_in_range.php
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@miqueiaspenha
miqueiaspenha / convert id_rsa to pem
Created October 5, 2020 13:17 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@miqueiaspenha
miqueiaspenha / htmlMinification.php
Created September 23, 2020 12:42 — forked from willmendesneto/htmlMinification.php
Simple HTML Output minifcation example
<?php
/**
* Minify HTML output (HTML)
*
* How to use:
*
* Call function using ob_start();
*
* if(extension_loaded('zlib') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE){
@miqueiaspenha
miqueiaspenha / validar_cpf.php
Created July 28, 2020 23:13 — forked from rafael-neri/validar_cpf.php
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export ANDROID_HOME=~/Android/Sdk
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
# Path to your oh-my-zsh installation.
export ZSH="/Users/diegofernandes/.oh-my-zsh"
export PATH="$PATH:/usr/local/bin"
@miqueiaspenha
miqueiaspenha / Dockerfile owncloud:latest
Created June 4, 2019 13:00 — forked from westberliner/Dockerfile owncloud:latest
Add ldap php extension to official owncloud docker container.
FROM owncloud:latest
RUN \
apt-get update && \
apt-get install libldap2-dev -y && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
docker-php-ext-install ldap