random Archives

  1. Redux Freezer

    Immutability is a fundamental part of how Redux stores work when used to follow the State-Action-Model pattern. Using a library such as immutable.js is recommended for the efficient deep object comparisons. However, when you are limited to using only ES6/lodash syntax in your web application, immutability can be hard to enforce when passing and mapping…

  2. HTTP v2

    I am now rocking the HTTP v2 protocol on my LAMP-based sites and page load times are nearly 400% faster over SSL. Production sites are seeing sub 100ms page loads in high traffic scenarios. Apache and Nginx both support this updated protocol out of the box as long as you are able to run OpenSSH…

  3. Google Compute Engine

    I recently migrated all of my servers from Amazon EC2, Rackspace and Linode to Google Compute Engine. Everything feels so much faster when tunneling through SSH or using anything IO related. Web pages are loading instantly to the point where I was able to remove caching layers in a few of my applications. Google Compute…

  4. Why ending net neutrality is bad or why Comcast sucks

    Think of it like electricity. Let’s say Sony buys your local power company… Sony rolls out a new deal, saying to you “given the size of your home, you pay us a flat $50 a month and we’ll give you enough electricity to power everything you could need in your house.” It’s the only deal…

  5. Ubuntu 14.04 LEMPH Stack

    The next LTS version of Ubuntu named Trusty Tahr was released last May. Servers I’ve upgraded to this release have been running without issues other than HHVM crashing every once in a while. I’ve since replaced HHVM with the standard PHP-FPM stack running PHP 5.6 resulting in nearly identical performance with added stability. MariaDB 10.0.x…

  6. WordPress without Apache Dir

    A simple htaccess to run Apache without the dir module. Specific versions of Apache 2.4.x contained issues when using the dir module with some htaccess rules. However, this didn’t resolve all issues I was having with Apache 2.4 and WordPress. Multisite WordPress support may not be fully supported with this example. # BEGIN WordPress RewriteEngine…

  7. Memory Compression Settings in OSX 10.9

    After updating OS X to Mavericks, I noticed context switching between large applications, or having large applications running in the background was significantly slower on the MacBook Air with 4GB of system memory. Enhanced support for memory compression was added in the update, which many sites reported to yield an overall system performance benefit. Searching…

  8. Using the IMDb dataset for testing MySQL performance

    I wanted a nice sized database for testing MySQL performance optimization techniques. I found that the full IMDb database can be downloaded using a Python script named IMDbPY.py Simple install on Debian / Ubuntu: sudo apt-get install python-imdbpy Download the imdby2sql script from here: http://sourceforge.net/p/imdbpy/code/ci/default/tree/bin/imdbpy2sql.py Download plain text data files from: ftp://ftp.fu-berlin.de/pub/misc/movies/database/ Additional mirrors: http://www.imdb.com/interfaces/…

  9. Parse URL parameters using JavaScript

    I recently found myself in a situation where I had very limited access to remote content and needed to perform specific actions conditionally. I wanted a quick and clean way to parse URL query parameters inline. var vars = {};   window.location.search.replace(/(?:^\??|&)([^&=]*)=?([^&]*)/g, function(i, j, k) { if (j) vars[j] = k; });var vars = {};…

  10. Add taxonomy terms to WordPress posts

    Using core WordPress functions is ideal when possible for modifying any content. However, when you have hundreds of thousands of posts, updating post content such as taxonomy terms on many items at once can be quite slow. Use SQL statements to quickly update your content only if you know you aren’t going to need any…