Skip to content

Instantly share code, notes, and snippets.

@jeffsmonteiro
jeffsmonteiro / seo-basic-checklist.html
Created August 31, 2016 19:16
SEO Basic Checklist
SEO Checklist
Meta Title - Max. 70 chars
<title>Title of page or Article</title>
Meta Description - Max 160 chars
<meta name="description" content="Some words about the page or the article">
Meta Keywords - Optional
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<?php
// Add in functions
// add_theme_support( 'post-thumbnails' );
// add_theme_support( 'title-tag' );
// To create slides, add a featured image on post and
// add a tag named slide
// To create a slide.php and save this gist, into theme
// subfolder named parts
@jeffsmonteiro
jeffsmonteiro / wordpress_content_test_html_tags_and_formating.txt
Created June 28, 2017 03:46
Wordpress Content Test Unit: HTML Tags and Formating
<h2>Headings</h2>
<h1>Header one</h1>
<h2>Header two</h2>
<h3>Header three</h3>
<h4>Header four</h4>
<h5>Header five</h5>
<h6>Header six</h6>
<h2>Blockquotes</h2>
Single line blockquote:
<blockquote>Stay hungry. Stay foolish.</blockquote>
@jeffsmonteiro
jeffsmonteiro / replace-wp-dashboard.php
Created August 9, 2017 02:08 — forked from wpscholar/replace-wp-dashboard.php
Replace the default WordPress dashboard with a custom one
<?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
*/
@jeffsmonteiro
jeffsmonteiro / Vagrantfile
Created October 15, 2017 21:03 — forked from jacksonpires/Vagrantfile
Vagrantfile Rails configuration
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
@jeffsmonteiro
jeffsmonteiro / gist:54ac4a001d86a1b64a6024f06402d285
Last active June 8, 2018 04:00 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increate max no of open files limit in Ubuntu 16.04 for Apache2
# 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
@jeffsmonteiro
jeffsmonteiro / Google Sheets Latin Slugify
Created April 4, 2019 22:41
Use this gist in Google Sheets Script Editor, after save use the function slugify into a cell
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));
@jeffsmonteiro
jeffsmonteiro / gist:6aa08ad3110eda74da6e4ad251477d15
Last active July 9, 2019 14:08
WordPress Snippet - Putting data in browser localStorage
/**********************************************************
* 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
***********************************************************/
@jeffsmonteiro
jeffsmonteiro / gist:451da98e6beb1a6601665b1696ebbfa2
Created August 6, 2019 02:36
Woocommerce jQuery Events List
(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
@jeffsmonteiro
jeffsmonteiro / distrance-matrix-php-google-maps.php
Created December 26, 2019 19:44
Calculates the distance between two address using PHP and Google Maps
/**
* @function getDistance()
* Calculates the distance between two address
*
* @params
* $addressFrom - Starting point
* $addressTo - End point
* $unit - Unit type
*
*/