brew uninstall --ignore-dependencies node icu4c
brew install node
<?php | |
/* | |
* | |
* Keep subscription active when order is paid for via SEPA. | |
* Works with parent and renewal orders. | |
* | |
*/ | |
add_action( 'woocommerce_order_status_changed', 'wcs_sub_active_SEPA', 10, 4 ); |
<?php | |
/* | |
Use this just like `add_filter()`, and then run something that calls the filter (like | |
`new WP_Query`, maybe). | |
That's it. If the filter gets called again, your callback will not be. | |
This works around the common "filter sandwich" pattern where you have to remember to | |
call `remove_filter` again after your call. |
server { | |
listen 80 default_server; | |
server_name domain.tld; | |
access_log /srv/www/domain.tld/logs/access.log; | |
error_log /srv/www/domain.tld/logs/error.log; | |
root /srv/www/domain.tld/public; | |
index index.php index.html index.htm; | |
client_max_body_size 20M; |
################################################################ | |
# Example configuration file for nginx | |
# | |
# To add a new local WordPress domain to your environment, copy | |
# this file using a filename that matches the domain you wish to | |
# setup. For example - mylocaldomain.com.conf would be an ideal | |
# filename for http://mylocaldomain.com | |
# | |
# Once copied, you will need to modify two settings in the server | |
# configuration provided: |
<?php | |
add_action( 'wp_login', 'wp_destroy_other_sessions' ); |
Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.
The following steps assume you've got a set-up like mine, where:
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
http://www.youtube.com/watch?v=-FRm3VPhseI Google's Clean Code Talks | |
http://blog.gordon-oheim.biz/2011-01-17-Why-Singletons-have-no-use-in-PHP/ | |
http://sebastian-bergmann.de/archives/882-Testing-Code-That-Uses-Singletons.html | |
http://eamann.com/tech/making-singletons-safe-in-php/ | |
http://hakre.wordpress.com/2012/06/10/the-missing-patterns-of-the-php-manual/#p2 | |
http://blogs.msdn.com/b/scottdensmore/archive/2004/05/25/140827.aspx | |
http://www.phptherightway.com/pages/Design-Patterns.html ("You should be wary when using the singleton pattern, as by its very nature it introduces global state into your application, reducing testability.") | |
http://www.practicaldesignpatternsinphp.com/ ("The Singleton Pattern is perhaps the most well known - and most often misused - pattern in all of PHP design pattern development. Its simplicity, combined with its seeming benefits makes it a widely-used (and overused) pattern. The Singleton is not so much a recommended pattern, as a pattern I recommend you shy away from.") | |
http://www.sli |