Categories
Webcams

Easily turn any webcam image into video on an OS X Dashboard widget

I have a few webcams on my network which I can access via URLs like http://198.162.1.30:8080/cam.jpg. Here’s a handy little bookmarklet (pagelet?) which allows you to turn any such webcam URL into live video (here, 1 fps): data:text/html,<img src=”http://198.162.1.30:8080/shot.jpg” onload=”var img = this; setTimeout( function(){ img.src = img.src; }, 1000 )”> Paste this  data:  URL into […]

Categories
Uncategorized

Regularly cleaning up /tmp on a DreamHost VPS

I ran into a problem recently where I was no longer able to upload a file via PHP. I checked the server error log, and I saw entries like: ModSecurity: Input filter: Failed writing X bytes to temporary file Looking at my /tmp directory it contained 128MB of data. Apparently ModSecurity tries to prevent the […]

Categories
WordPress

Re: Sharing Sidebars Across a Multisite Network

In a post yesterday at WebDevStudios about “Sharing Sidebars Across a Multisite Network”, I was reminded of a workaround that I had to put into the Widget Customizer plugin. There is this unfortunate condition inside of the core wp_get_sidebars_widgets() function: // If loading from front page, consult $_wp_sidebars_widgets rather than options // to see if wp_convert_widget_settings() has made […]

Categories
CLI

Quick check if merge will break the build

Quickly check from feature branch if merging will break the target branch (e.g. develop): git merge –no-commit develop .git/hooks/pre-commit # assuming you added this hook git merge –abort

Categories
WordPress

Revelations about filter_input

WordPress has the unfortunate legacy situation of having to force input variables to be “magic quoted”, something which has been deprecated in PHP for some time. So when you are working with data passed from the user, you have to run those input variables ($_GET, $_POST, $_REQUEST) through stripslashes(), which is really annoying. At least […]

Categories
WordPress

Config-Driven WordPress at PDXWP

Tonight at the Portland WordPress User Group (PDXWP), I’m speaking on “Config-Driven WordPress”. See the proof of concept repo on GitHub, and here’s my presentation:

Categories
WordPress

List of Functions Removed from WordPress 3.6 RC2 since Beta 3 (and Added too)

On an ongoing client project at X-Team, since the site was to launch in the summer we took the initiative to build a new site on WordPress 3.6 trunk “knowing” that it would be released before then, and so we could utilize the new Post Formats UI and functions that went along with it. Alas. […]

Categories
WordPress

Do not change the default timezone from UTC in WordPress

I discovered something a bit surprising about WordPress related to timezones: WordPress explicitly sets and expects the default timezone to be UTC (in settings.php) and the date/time functions sometimes rely on the fact that the default timezone is UTC. For instance if you do date_default_timezone_set(get_option(‘timezone_string’)) and then later try to get a GMT timestamp from get_post_time() […]

Categories
Technology

Showing support for JavaScript and the Mozilla Developer Network

If you want to see access to JavaScript documentation improve on the Web, grab a copy of the code above from PromoteJS to boost the MDN PageRank. Dare I say, we must take the top spots away from W3Schools.

Categories
Uncategorized

My X-Team Superhero Identity Revealed

Tonight we at X-Team had a very special meeting: the induction ceremony for new superheroes! X-Team employees are given superhero identities, and I was next in line for induction along with Wojtek Zając and Ben King. Our meeting was extra special because five of us have been together in Los Angeles this month working for […]