Skip to content

Instantly share code, notes, and snippets.

View asllanmaciel's full-sized avatar
🎯
Focusing

Asllan Maciel asllanmaciel

🎯
Focusing
View GitHub Profile
@asllanmaciel
asllanmaciel / ramos_de_atividade.txt
Created September 18, 2022 22:59 — forked from prodis/ramos_de_atividade.txt
Lista de ramos de atividade
Alimentos e Bebidas
Arte e Antiguidades
Artigos Religiosos
Assinaturas e Revistas
Automóveis e Veículos
Bebês e Cia
Blu-Ray
Brindes / Materiais Promocionais
Brinquedos e Games
Casa e Decoração
@asllanmaciel
asllanmaciel / functions.php
Created July 20, 2022 22:04
Generate Featured Image From Url Raw
<?php
//WORDPRESS
//$image_url is the url of image you want to upload
//$post_id is the id of post which you need to add featured image
function generate_featured_image( $image_url, $post_id ){
$upload_dir = wp_upload_dir();
$image_data = file_get_contents($image_url);
$filename = basename($image_url);
if(wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'] . '/' . $filename;
else $file = $upload_dir['basedir'] . '/' . $filename;
@asllanmaciel
asllanmaciel / validar_cpf.php
Created June 7, 2022 20:16 — 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;
@asllanmaciel
asllanmaciel / elementor-form-additional-webhook.php
Created March 22, 2022 21:08 — forked from csalzano/elementor-form-additional-webhook.php
Elementor Form additional webhook example
<?php
/**
* Plugin Name: Elementor Form Additional Webhook
* Plugin URI: https://gist.github.com/csalzano/dfd754e0fe8b6ac10731fad8f257c0bf
* Description: Adds a second Webhook to an Elementor form
* Version: 1.0.1
* Author: Corey Salzano
* Author URI: https://breakfastco.xyz/
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@asllanmaciel
asllanmaciel / DNS Prefetch domains
Created October 8, 2021 20:34 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@asllanmaciel
asllanmaciel / wp_config.php
Created October 7, 2021 00:16 — forked from butlerblog/wp_config.php
Configure WordPress #wp_mail function to send through #SMTP server https://b.utler.co/Y3
<?php
/*
* Set the following constants in wp-config.php.
* These should be added somewhere BEFORE the constant ABSPATH is defined.
*
* Author: Chad Butler
* Author URI: https://butlerblog.com
*
* For more information and instructions, see: https://b.utler.co/Y3
@asllanmaciel
asllanmaciel / delete-orphans-usermeta.sql
Created September 30, 2021 18:26 — forked from carlosleopoldo/delete-orphans-usermeta.sql
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
@asllanmaciel
asllanmaciel / gist:69e2a3053704dde595656c72b512dc14
Created August 11, 2021 23:57 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@asllanmaciel
asllanmaciel / estados.php
Created August 11, 2021 17:02 — forked from ricardobarantini/estados.php
Array com nome e siglas de estados Brasileiros para select do Codeigniter
$estadosBrasileiros = array(
'AC'=>'Acre',
'AL'=>'Alagoas',
'AP'=>'Amapá',
'AM'=>'Amazonas',
'BA'=>'Bahia',
'CE'=>'Ceará',
'DF'=>'Distrito Federal',
'ES'=>'Espírito Santo',
'GO'=>'Goiás',