Skip to content

Instantly share code, notes, and snippets.

View luiseduardobraschi's full-sized avatar
🤓
Updating knowledgebase...

Luis Braschi luiseduardobraschi

🤓
Updating knowledgebase...
View GitHub Profile
@0xdevalias
0xdevalias / reverse-engineering-webpack-apps.md
Last active May 15, 2024 05:55
Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue/Angular) apps
@emanweb
emanweb / vendasporanoeestado.php
Last active May 24, 2022 12:08
Relatório de vendas por ano e estado brasilero para WooCommerce
/**
* @snippet Relatorio de vendas por ano e estado brasileiro @ WooCommerce Admin
* @sourcecode https://gist.github.com/emanweb/3272d93d481e8c749edaa2cce2641b28
* @author Emanuel Costa
* @testedwith WooCommerce 6.3.1
* @inspiredby https://businessbloomer.com/?p=72853 (Rodolfo Melogli)
* @instructions Inclua esse código no functions.php to seu tema filho (child theme)
*/
// -----------------------
@luiseduardobraschi
luiseduardobraschi / Referência de filtros Marketplace-Melhor Envio.md
Last active August 7, 2022 22:05
Referência de filtros Marketplace/Melhor Envio

Utilidades

add_filter( 'arti_mpme_show_messages_in_cart', '__return_true' );

Mostra mensagens de debug ("depuração") no carrinho para usuários administradores referentes ao cálculo do frete, como erros de configuração do vendedor e mensagens de retorno da API.

add_filter( 'arti_me_force_agency_list_update', '__return_true' );
@emilfolino
emilfolino / cbsg.bash
Created November 29, 2019 06:42
Corporate Bullshit Generator
curl -s http://pasta.phyrama.com:8083/cgi-bin/live.exe | grep -Eo '^<li>.*</li>' | sed s,\</\\?li\>,,g | shuf -n 1
@mikeschinkel
mikeschinkel / _readme.md
Last active January 24, 2023 05:47
Examples for how a __toArray() magic method could be useful in PHP.

Examples for how a __toArray() magic method could be useful in PHP.

In a nutshell, __toArray() would not be as useful when you have full control over the entire codebase.

But where __toArray() would be extremely useful is in interfacing with existing code that expects arrays and wants those arrays to be a specific format. Using classes and type-hinted methods allow to encapsulate the intelligence into the class, and using __toArray() makes for a nature use-case.

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
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"
@luiseduardobraschi
luiseduardobraschi / SublimeLinter.sublime-settings
Created April 14, 2018 20:49
Correcting the error "SublimeLinter: WARNING: phpcs cannot locate 'phpcs'" on Ubuntu 16.04
// SublimeLinter Settings - User
{
"paths":
{
"linux": ["~/.config/composer/vendor/bin"]
}
}
@fernandoacosta
fernandoacosta / functions.php
Last active January 29, 2020 17:04 — forked from SiR-DanieL/functions.php
Exibir produtos recentes quando nenhum produto for encontrado na busca
add_action( 'woocommerce_no_products_found', 'show_products_on_no_products_found', 20 );
function show_products_on_no_products_found() {
echo '<h2>' . __( 'Mas você pode gostar disso...', 'domain' ) . '</h2>';
echo do_shortcode( '[recent_products per_page="4"]' );
}
@luiseduardobraschi
luiseduardobraschi / toggle.js
Last active December 9, 2017 20:14
A bookmarklet to quickly toggle admin bar in WordPress .
javascript: (function() {
var htmlStyle = document.documentElement.style;
var adminBarStyle = document.getElementById('wpadminbar').style;
if(undefined == window.hasAdminBar){
window.hasAdminBar = true;
}
var cssText, display;