View functions.php
add_action('wp_ajax_cart_count', 'custom_cart_count');
add_action('wp_ajax_nopriv_cart_count', 'custom_cart_count');
function custom_cart_count() {
echo WC()->cart->cart_contents_count;
add_action('wp_enqueue_scripts', 'custom_scripts');
View wp-multiple-database.php
$wpdb2 = new wpdb('USER', 'PASS', 'DB_NAME', 'HOST');
$sql = "SELECT *
FROM wp_posts
WHERE post_type = 'product'
AND post_status = 'publish'
$products = $wpdb2->get_results($sql, ARRAY_A);
DISPLAY=:0 nohup chromium URL_TO_OPEN_ON_REMOTE_BROWSER > /dev/null &
View woocommerce-email-custom-locale.php
* Plugin Name: Slovak WooCommerce emails
* Plugin URI:
* Description: Send only slovak WooCommerce emails
* Version: 1.0.0
* Author: Michal Zuber
* Author URI:
if (!defined('ABSPATH')) {
View .htaccess
# ~~start~~ Do not remove this comment, prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by prestashop e-commerce open-source solution
# -
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
RewriteEngine on
View .gitconfig
last-month = !git log --reverse --pretty=format:'%cd %h %s' --date=short --no-merges --since=$(date -d \"$(date +%Y-%m)-01 last month\" \"+%Y-%m-01\") --author=$(git config
View chrome-search-engine-remove.js
document.querySelectorAll('#other-search-engine-list [selected] .row-delete-button').forEach(function(el) {;})
View phinx-sf2-migrate.php
use Phinx\Console\PhinxApplication;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpFoundation\Response;
public function migrateDbAction()
$kernel = $this->get('kernel');
View vim-fugitive-shortcuts
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
find . -name '*.php' | xargs -i php -l {} | grep -v 'No syntax errors'