This list served quite some people but someone else did a better job since.
Go to https://github.com/umpirsky/country-list for a list in your language and format.
I've also compiled a list of nationalities
This list served quite some people but someone else did a better job since.
Go to https://github.com/umpirsky/country-list for a list in your language and format.
I've also compiled a list of nationalities
require 'rubygems' | |
require 'mechanize' | |
BASE = 'http://manure.myshopify.com/admin' | |
LOGIN = '/auth/login' | |
USER = 'paddy@cow.com' | |
PWD = 'moo-moo' | |
agent = Mechanize.new | |
page = agent.get(BASE+LOGIN) | |
form = page.forms.first | |
form.login = USER |
# http://forums.shopify.com/categories/6/posts/42926 | |
# This is a fairly simple mechanize script to create a few hundred or so shopify discounts from a CSV of groupon codes. | |
# You'll want to change all of the "changeme" values to your own. | |
# The script expects there to be a groupon_codes.csv in the same directory. | |
# | |
# The groupons_code.csv should look like this: | |
# 8m7677 | |
# 8m6749 | |
# 8m5398 | |
# 8m7699 |
<?php | |
/** | |
* WordPress function for redirecting users on login based on user role | |
*/ | |
function my_login_redirect( $url, $request, $user ){ | |
if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) { | |
if( $user->has_cap( 'administrator' ) ) { | |
$url = admin_url(); | |
} else { |
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |
<?php | |
/** | |
* Plugin Name: Filename-based cache busting | |
* Version: 0.3 | |
* Description: Filename-based cache busting for WordPress scripts/styles. | |
* Author: Dominik Schilling | |
* Author URI: https://dominikschilling.de/ | |
* Plugin URI: https://gist.github.com/ocean90/1966227/ | |
* | |
* License: GPLv2 or later |
# | |
# Sources: | |
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites | |
# http://codex.wordpress.org/Output_Compression | |
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086 | |
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/ | |
# http://gtmetrix.com/configure-entity-tags-etags.html | |
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014 | |
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress | |
# https://andreashecht-blog.de/4183/ |
var tweet = "Currently chilling out at W1B 2EL, then on to WC2E 8HA or maybe even L1 8JF! :-)"; | |
// Here's a simple regex that tries to recognise postcode-like strings. | |
// See http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation | |
// for the rules on how UK postcodes are formatted. | |
var postcode_regex = /[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/g; | |
var postcodes = tweet.match(postcode_regex); | |
console.log(postcodes); |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
/** | |
* The pseudo-element 'content' property doesnt accept normal (») style | |
* HTML entities. These variables below easy the pain of looking up the HEX codes... | |
* | |
* Referenced from http://www.danshort.com/HTMLentities/ | |
* | |
* TODO: Add all the other entities? Worth it? Some day? Maybe? | |
*/ | |
// Punctuation |