This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# INSTALL OPENSSL | |
cd /usr/local/src/ | |
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz | |
tar -xf openssl-1.1.1g.tar.gz | |
cd openssl-1.1.1g | |
sudo ./config -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)' | |
sudo make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-server mysql-server-8.0 | |
sudo apt-get remove --purge mysql* | |
sudo apt-get purge mysql* | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
sudo apt-get remove dbconfig-mysql | |
sudo apt-get dist-upgrade | |
/* WARNING: THIS WILL DELETE ALL THE DATA INCLUDING YOUR DATABASES */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. BEFORE ANYTHING | |
$ sudo su | |
# 1. UPDATING THE SERVER | |
# Define your timezone | |
$ timedatectl set-timezone America/Sao_Paulo | |
# Update packages | |
$ apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @function getDistance() | |
* Calculates the distance between two address | |
* | |
* @params | |
* $addressFrom - Starting point | |
* $addressTo - End point | |
* $unit - Unit type | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(WIP) This file contains a list with Woocommerce jquery events | |
Usage: you can fire functions when some event happen | |
Example: | |
$(document.body).on('woocommerce_event', function(){ | |
// do stuff | |
}); | |
Events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************** | |
* Use this script to set data in localStorage (client side) | |
* this data will be available in client browser and you | |
* can use it with javascript manipulation | |
* | |
* tags: wordpress, client side, localStorage, setItem | |
* | |
* by: Jeff Monteiro | |
***********************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;"; | |
var to = "aaaaaeeeeeiiiiooooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# maximum capability of system | |
user@ubuntu:~$ cat /proc/sys/fs/file-max | |
708444 | |
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 200000 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = '2' | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = '<your>/<box>' | |
config.ssh.insert_key = false # linha obrigatória para Windows | |
config.vm.network :forwarded_port, guest: 3000, host: 3000 # rails | |
config.vm.network :forwarded_port, guest: 9292, host: 9292 # rack | |
config.vm.network :forwarded_port, guest: 4567, host: 4567 # sinatra | |
config.vm.network :forwarded_port, guest: 1080, host: 1080 # mailcatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Replace WordPress Dashboard | |
* Description: Replaces the default WordPress dashboard with a custom one. | |
* Author: Micah Wood | |
* Author URI: http://micahwood.me | |
* Version: 0.1 | |
* License: GPL3 | |
*/ |
NewerOlder