Skip to content

Instantly share code, notes, and snippets.

View eduardorangell's full-sized avatar
🍺
Earned: Hangover

Eduardo Rangell eduardorangell

🍺
Earned: Hangover
View GitHub Profile
@lukecav
lukecav / functions.php
Last active November 18, 2021 16:52
Autoptimize Automatic Cache Purge - Set to be 2GB in size
// Automatically clear Autoptimize cache if it goes beyond 2GB
if (class_exists('autoptimizeCache')) {
$myMaxSize = 2000000; # You may change this value to lower like 500000 for 500MB if you have limited server space
$statArr=autoptimizeCache::stats();
$cacheSize=round($statArr[1]/1024);
if ($cacheSize>$myMaxSize){
autoptimizeCache::clearall();
header("Refresh:0"); # Refresh the page so that autoptimize can create new cache files and it does breaks the page after clearall.
}
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@davidalves1
davidalves1 / to_upper.js
Last active January 27, 2022 16:28
Função javascript para deixar a primeira letra de cada palavra maiúscula
'use strict';
// Captura os parâmetros passados após o nome do arquivo
var name = process.argv.splice(2, process.argv.length -1);
name = wordUpper(name).join(' ');
console.log(name);
function wordUpper(arrWords) {
@eyecatchup
eyecatchup / get-win7-productkey.vbs
Created August 16, 2014 15:52
VBS Script to get the Windows(R) 7 Product Key from a PC's registry.
' VBS Script to get the Windows(R) 7 Product Key from a PC's registry.
'
' Save the VBScript as "getWin7Key.vbs" somewhere on your Windows7 PC.
' Now, when you double-click the local script file an alertbox pops up
' displaying the product key stored in the machine's Windows registry.
Set WshShell = WScript.CreateObject("WScript.Shell")
KeyPath = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"
MsgBox ExtractKey(WshShell.RegRead(KeyPath))
@igorcosta
igorcosta / cpf_cnpj_validator
Created June 26, 2014 19:13
Regex para validar CPF e CNPJ
Para CPF
/^\d{3}\.\d{3}\.\d{3}\-\d{2}$/
Para CNPJ
/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/
Para ambos ao mesmo tempo