Skip to content

Instantly share code, notes, and snippets.

View contactjavas's full-sized avatar
🎯
Focusing on MapSteps

Bagus contactjavas

🎯
Focusing on MapSteps
View GitHub Profile
@mpdevcl
mpdevcl / woocommerce_events.md
Created August 11, 2020 17:43
WooCommerce JS Events

WooCommerce JS Events

Source

Checkout

$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
@bagerathan
bagerathan / woo-events.js
Last active January 7, 2025 12:27
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@odan
odan / Slim 4 Tutorial.md
Last active January 15, 2022 11:22
Slim 4 Tutorial
@mihdan
mihdan / is_gutenberg_active.php
Created November 11, 2018 19:34 — forked from kagg-design/is_gutenberg_active.php
Function to check if Gutenberg is active.
/**
* Check if Gutenberg is active.
* Must be used not earlier than plugins_loaded action fired.
*
* @return bool
*/
private function is_gutenberg_active() {
$gutenberg = false;
$block_editor = false;
@slowkow
slowkow / Apache www-data setup
Last active August 4, 2024 21:21 — forked from milo/github-webhook-handler.php
Github webhook handler in PHP.
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R www-data:www-data /var/www/.ssh
sudo -u www-data ssh-keygen (empty passphrase)
# On Github, paste public key into "Deploy keys"
sudo -u www-data bash
cd /path/to/repo
git clone ...
@kharakhordindemo
kharakhordindemo / form.php
Created December 22, 2017 15:21
Remove span in Contact Form 7
/*Contact form 7 remove span*/
add_filter('wpcf7_form_elements', function($content) {
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content);
$content = str_replace('<br />', '', $content);
return $content;
});
@ediamin
ediamin / wpautop.js
Created February 27, 2017 09:49
JavaScript version of WordPress wpautop function
// source: https://github.com/andymantell/node-wpautop
function _autop_newline_preservation_helper (matches) {
return matches[0].replace( "\n", "<WPPreserveNewline />" );
},
function wpautop(pee, br) {
if(typeof(br) === 'undefined') {
br = true;
}
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@jaredjburgess
jaredjburgess / vex.dialog.buttons.js
Created March 3, 2016 15:58
Vex buttons for a confirm dialog.
buttons: [
$.extend({}, vex.dialog.buttons.YES, {
text: 'Yes'
}), $.extend({}, vex.dialog.buttons.NO, {
text: 'Cancel'
})
]
@gsherwood
gsherwood / ruleset.xml
Created December 5, 2014 20:06
PSR2 with tabs instead of spaces
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>PSR2 with tabs instead of spaces.</description>
<arg name="tab-width" value="4"/>
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>