Skip to content

Instantly share code, notes, and snippets.

View wilnaweb's full-sized avatar

Wilson Cavalcante wilnaweb

View GitHub Profile
@wilnaweb
wilnaweb / html5pattern.txt
Last active July 18, 2018 21:45
Pattern HTML5 para CPF e CNPJ
CPF: "\d{3}.\d{3}.\d{3}-\d{2}"
CNPJ: "\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}"
Telefone: "\([0-9]{2}\)[\s][0-9]{4}-[0-9]{4}"
Celular: "\([0-9]{2}\) [0-9]{4,6}-[0-9]{3,4}$"
Test:
CPF: http://bit.ly/2h7DnvF
CNPJ: http://bit.ly/2jv9xlU
Telefone: https://bit.ly/2LtZSoU
Celular: https://bit.ly/2mtjnDq
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@ollietreend
ollietreend / acf-php-to-json.php
Last active April 22, 2024 11:12
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@LifeofGeek
LifeofGeek / fbpagebot.php
Last active April 19, 2018 01:21
Gist to Integrate Facebook Messenger bot with Program O Chatbot. Read the complete Guide/Tutorial @ https://www.lifeofgeek.com/build-responsive-facebook-messenger-bot/
<?php
/**
* Webhook for Facebook Messenger Bot with Program O
* Tutorial Link: https://www.lifeofgeek.com/build-responsive-facebook-messenger-bot/
*/
$access_token = "EAAT06zIHufkBAHewZCWZCBYAWKGJlS5uVOS3aEoIqSROiKZAuR8"; //Replace with your page access token
$verify_token = "lifeofgeek"; //Replace with your app verify token
$hub_verify_token = null;
@esamattis
esamattis / .gitignore
Created September 7, 2016 10:42 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@atomtigerzoo
atomtigerzoo / wordpress-disable-yoast-seo-on-custom-post-type.php
Created March 31, 2016 12:39
Wordpress: Disable Yoast SEO on Custom Post Type
function my_remove_wp_seo_meta_box() {
remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal');
}
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100);
@needim
needim / mediaqueries.css
Last active April 4, 2024 23:23
Device Specific CSS Media Queries Collection
/*
Based on:
1. http://stephen.io/mediaqueries
2. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* iPhone X in portrait & landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@thallisphp
thallisphp / Meses e Dias - Array.php
Last active September 21, 2023 15:45
Array com nomes dos meses e dias da semana em português do Brasil
<?php
$meses = array(
1 => 'Janeiro',
'Fevereiro',
'Março',
'Abril',
'Maio',
'Junho',
'Julho',