Skip to content

Instantly share code, notes, and snippets.

Celso Bessa celsobessa

Block or report user

Report or block celsobessa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
celsobessa / shortcodes-in-custom-fields.php
Last active May 15, 2018
Usando shortcodes WordPress em campos customizados (WordPress shortcodes in custom fields)
View shortcodes-in-custom-fields.php
// opção 1: função do_shortcode
// veja
echo do_shortcode( $content, false );
// opção 2: o filtro the_content
// veja
echo apply_filters('the_content', $content);
// pega um campo customizado em post e passa para do_shortcode
// veja
celsobessa / wordpress_export-post-data.php
Created Jul 16, 2018 — forked from robinnorth/wordpress_export-post-data.php
WordPress: Simple, configurable script to export post data to a CSV file
View wordpress_export-post-data.php
* Export WordPress post data to CSV
* Based on <> and <>
* Configuration
celsobessa / check-hooked-actions-filters.php
Last active Feb 21, 2019
Helper functions for developing and debugging WordPress plugins and themes
View check-hooked-actions-filters.php
* Prints all actions and filters hooked to a given hook.
* Prints all actions and filters hooked to a given hook.
* Inspired by answers in this WordPress Stackexchange question:
function what_is_hooked(){
$hook_name = current_filter();
global $wp_filter;
celsobessa / regexCheatsheet.js
Created Jan 15, 2019 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
View regexCheatsheet.js
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
celsobessa / .gitignore
Last active Jun 18, 2019 — forked from salcode/.gitignore
a fork of salcode .gitignore file for a general web project - Bare Minimum Git
View .gitignore
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# ver 20181206
# From the root of your project run
# curl -O
# to download this file
celsobessa / isEmpty.js
Last active May 29, 2019
isEmpty, a javascript helper for checking if objects are empty.
View isEmpty.js
// check all properites in a object as explained by Viktor Borisov on
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) return false;
return true;
// use Examples
celsobessa / parseUri.1.2.2.js
Created Jun 4, 2019
parseUri 1.2.2 by Steven Levithan
View parseUri.1.2.2.js
// parseUri 1.2.2
// (c) Steven Levithan <>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
celsobessa / sleep-es6.js
Created Jun 14, 2019
sleep() equivalent for vanilla Javascript using ES6 features
View sleep-es6.js
// sleep() equivalent for vanilla Javascript using ES6 features
// created by Dan Dascalescu
// see
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
async function demo() {
console.log('Taking a break...');
celsobessa /
Created Jul 19, 2019 — forked from cbessadejusticia/ script by Alfred Klomp for optimizing (shrinking) PDF files using Ghostscript
# Licensed under the 3-clause BSD license:
# Copyright (c) 2014, Alfred Klomp
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
celsobessa /
Created Nov 2, 2019 — forked from jexchan/
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C ""
You can’t perform that action at this time.