South Napa Earthquake Surface Rupture Mapped

Mike Oskin (@mikeoskin) from U.C. Davis tweeted on late Sunday that PhD students Alex Morelan and Chad Trexler had gone out in the field in the Napa area and mapped several surface ruptures related to the South Napa earthquake of Aug 24, 2014. Additional tweets showed pictures of the ruptures. 16 km of rupture, max […]

Nagios, Belkin WeMo and a Plasma Globe

I monitor a number of servers using nagios and I always thought it would be neat to be able to have some sort of ambient device light up when there was a critical problem. Yes, I get email and text alerts, and nagios is always up in one tab on my browser, but I wanted […]

Poor Design – Yahoo Asks You To Upgrade Firefox Within Safari

Every so often I have the opportunity to help a friend with a seemingly intractable computer problem. More often than not, the problem is not really a problem at all, it is just plain awful design. Case in point: My friend was using Safari and this appeared every time he wanted to access his email. […]

Nginx with php-fpm generating blank page

I struggled a long time trying to figure out why my nginz + php-fpm setup was not working. I could tell that the gateway was fine and I was getting a HTTP 200 OK response, but the output was blank and there were no illuminating entries in either the nginx or php-fpm logs. After a […]

Get the first N words with Javascript

Here’s how I get the first 20 words using a regular expression and the Javascript replace function. I place an ellipsis at the end to indicate that the sentence was shortened: var str1 = “Here is a sentence that just seems to go on and on. Here is a sentence that just seems to go […]

Find a Javascript parent node that matches a certain string

Here’s a small bit of javascript that I use in my Sencha Touch projects to find a parent with an id that matches a string. function findParentNodeRegex(regex, childObj) { var testObj = childObj; var count = 1; while(!testObj.id.match(regex)) { //console.log(‘My name is ‘ + testObj.id + ‘. Let\’s try moving up one level to see […]

Click poster frame to start HTML5 video using jQuery

I needed to have an HTML5 video with a clickable poster frame. The first issue was that Safari would preload the movie, removing the poster frame after a few seconds. I fixed that by setting preload=”none”: <div id=”promovid”> <video id=”video” controls=”controls” poster=”video-poster.jpg” preload=”none” width=”640″ height=”480″> … </div> Them to make the poster frame clickable, I […]