sudo apt-get install \
cmake cmake-data libcairo2-dev libxcb1-dev libxcb-ewmh-dev \
libxcb-icccm4-dev libxcb-image0-dev libxcb-randr0-dev \
libxcb-util0-dev libxcb-xkb-dev pkg-config python-xcbgen \
xcb-proto libxcb-xrm-dev i3-wm libasound2-dev libmpdclient-dev \
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
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> |
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
// Go to Radarr and click 'settings' => 'general'. | |
// Open the JavaScript Console in Google Chrome (View => Developer => Javascript Console) | |
// Past the following in. Hit enter and away you go. | |
const key = document.getElementsByClassName('x-api-key')[0].value; | |
if (!key) { | |
alert('Navigate to /settings/general and run again'); | |
} |
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
/** | |
* NB: updated version available here: https://github.com/helgatheviking/add-to-cart-form-shortcode | |
*/ | |
/** | |
* Add [add_to_cart_form] shortcode that display a single product add to cart form | |
* Supports id and sku attributes [add_to_cart_form id=99] or [add_to_cart_form sku=123ABC] | |
* Essentially a duplicate of the [product_page] | |
* but replacing wc_get_template_part( 'content', 'single-product' ); with woocommerce_template_single_add_to_cart() | |
* |
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
<?php | |
// ref: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ | |
// Validate Email | |
if (filter_var('test+email@fexample.com', FILTER_VALIDATE_EMAIL)) { | |
echo "Your email is ok."; | |
} else { | |
echo "Wrong email address format."; | |
} | |
//Validate Username |
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
<?php | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
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
#!/bin/sh | |
# Written by: Keefer Rourke <https://krourke.org> | |
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git> | |
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git | |
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git | |
srcdir="/tmp/google-fonts" | |
pkgdir="/usr/share/fonts/truetype/google-fonts" | |
giturl="git://github.com/google/fonts.git" |
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
<?php | |
$string = 'Hi, visit my website: http://beto.euqueroserummacaco.com'; | |
$string = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $string); | |
echo $string; | |
?> |
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
// Your server must have wp-cli installed (http://wp-cli.org/) | |
var async = require("async"); | |
var exec = require("child_process").exec; | |
var cores = 32; // Adjust the number of cores to match your environment | |
var total = 0; | |
var finished = 0; | |
var q = async.queue(function(task, callback) { |
OlderNewer