Send email to Admin when user/member updates specific user/member data

I have previously asked about How to automatically send email to Admin when a user/member changes his/hers profile data. And got some very good answers. Send automatic mail to Admin when user/member changes/adds profile Now a follow up: I only want to send/email the data (profiledata) that was updated/added. 2 Answers 2 So, as Bainternet … Read more

How to trigger XDebug profiler for a command line PHP script?

XDebug offers the configuration directive xdebug.profiler_enable_trigger that allows to activate profiling by passing the GET or POST parameter “XDEBUG_PROFILE” when calling a script via HTTP. This is handy if you don’t want profiling for ALL of your scripts but only for a few special cases without always changing your PHP configuration. Is there a way … Read more

Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times

Question Since I am using multiple instances of home_url() in one page template, I was curious if the following method would speed up my page load time. My method is to store the output of home_url() within a variable and then call that variable each time, rather than using home_url() each time. Motivation The reason … Read more

How do I profile memory usage in Python?

I’ve recently become interested in algorithms and have begun exploring them by writing a naive implementation and then optimizing it in various ways. I’m already familiar with the standard Python module for profiling runtime (for most things I’ve found the timeit magic function in IPython to be sufficient), but I’m also interested in memory usage … Read more

Simplest way to profile a PHP script

What’s the easiest way to profile a PHP script? I’d love tacking something on that shows me a dump of all function calls and how long they took but I’m also OK with putting something around specific functions. I tried experimenting with the microtime function: $then = microtime(); myFunc(); $now = microtime(); echo sprintf(“Elapsed: %f”, … Read more