Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue/Angular) apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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) | |
*/ | |
// ----------------------- |
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' );
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s http://pasta.phyrama.com:8083/cgi-bin/live.exe | grep -Eo '^<li>.*</li>' | sed s,\</\\?li\>,,g | shuf -n 1 |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// SublimeLinter Settings - User | |
{ | |
"paths": | |
{ | |
"linux": ["~/.config/composer/vendor/bin"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function() { | |
var htmlStyle = document.documentElement.style; | |
var adminBarStyle = document.getElementById('wpadminbar').style; | |
if(undefined == window.hasAdminBar){ | |
window.hasAdminBar = true; | |
} | |
var cssText, display; |
NewerOlder