Overriding setInterval with a better implementation

JavaScript includes two built-in options for timing and delaying actions, setInterval() and setTimeout(). These functions have been around since before the first ECMA specifications, so their implementations across browsers are largely non-standardized and inconsistent. I’ve noticed some problems with setInterval(), particularly when it’s left in a background tab. See the issues and how to solve them

Tagged with: ,
Posted in Custom Library Functions, GitHub, JavaScript

Exploring the past: My old TI-BASIC programs

Like many others around my age, my first exposure to programming came from my TI graphing calculator and its built in TI-BASIC programming language. I recently pulled out my old TI-83+ for a bit of nostalgic fun, and I copied out a few of the programs I remember writing. It’s interesting revisiting these almost a decade later and trying to figure out just what exactly I was thinking when I wrote them. Experience the glory of TI-BASIC

Tagged with: ,
Posted in General Musings

Self-hosted moderated chat room and liveblog project

A few months ago I contacted Brian Cook, proprietor of one of the best sports blogs on the Internet, MGoBlog. A year or so earlier I had created a userscript that improved some functionality for his site, and I thought he might be interested in building some of that JS directly into the site so it would benefit every user. Instead we ended up discussing a few other projects, including an open-source alternative for the relatively expensive moderated liveblog systems the site uses for Michigan football gamedays. These are the results of that project so far. See the project

Tagged with: , , , , ,
Posted in GitHub, HTML & CSS, JavaScript, jQuery, MySQL, PHP, Server Side Code

Bing spelling suggestions and WordPress search

I’m a truly terrible speller, so when I was testing out the search functionality on this site it became very clear to me how much I rely on Google’s spelling suggestions and how deficient any search without that feature feels. I was surprised to find that there were no existing WordPress plugins that could easily add this functionality, so I decided to see how hard it would be to implement that functionality myself. As it turns out, with the right API account a simple spelling suggest feature is fairly straightforward to build. How to do it

Tagged with: , , ,
Posted in PHP, Server Side Code, WordPress

Linking to a CodePlex project’s latest source code

CodePlex is a source code distribution platform that stacks up against the competition (like GitHub) very nicely. The one feature I found myself wishing I could find for my CodePlex projects is one that GitHub does very easily: permanent links to download the latest source code of a project. Even though this isn’t provided by CodePlex itself, it’s fairly easy to set up your own service to link to your latest code. How to do it

Tagged with: , , ,
Posted in CodePlex, PHP, Server Side Code

Create and secure your own proxy with cURL and MCrypt

JavaScript’s same-origin policy can be a pain. Of course it’s very necessary for security reasons, but sometimes you want to access a remote web service client-side, or manipulate the display of remote content in an iframe. There’s a still a way to do these things of course, and it’s to build a server-side interface for the remote site and attach your JavaScript to that. Building a generic proxy-style interface is tempting, but can be dangerous if it’s not properly secured. Luckily, securing such a system is possible and relatively simple. See it in action

Tagged with: , ,
Posted in HTML & CSS, PHP, Server Administration, Server Side Code, Try It

Prevent auto visual upgrade on new SharePoint 2010 sites

When migrating a SharePoint site collection from 2007 to 2010, you have the option to put your site through the “visual upgrade” process, which basically means trading in all the 2007 UI features for their 2010 counterparts. For most simple sites this is a good idea, but for highly customized publishing sites it can cause quite a few problems. Apparently Microsoft didn’t think about those problems, because once the site collection is on the 2010 server, any new subsites created within it will default to the 2010 UI, and no option is available to prevent this. How to prevent it anyway

Tagged with: , ,
Posted in .NET, .NET for SharePoint, CodePlex, Server Side Code, SharePoint

Google Chrome for Windows is terrible at web fonts

Dear Google Chrome: get better at web fonts. Seriously, this is bordering on unacceptable. This is a company that provides the fantastic Google Web Fonts service, and their own browser manages to render fonts worse than any browser I’ve ever used, including ancient IE. That’s right, I said it, on at least this one issue, Chrome is significantly worse than even Internet Explorer. Harsh but true. Some Workarounds

Tagged with: , ,
Posted in HTML & CSS, JavaScript

Getting the most out of WordPress custom fields

WordPress custom fields are a pretty nifty idea that can allow you to add custom content to individual posts, outside of the standard content area. Most examples on how to implement custom fields show fairly innocuous uses, just inserting little strings of text in various locations. However, by populating the custom field with wonderfully portable JSON, it’s possible to perform much more complex and powerful actions on individual posts and pages. See it in action

Tagged with: ,
Posted in HTML & CSS, PHP, Server Side Code, WordPress

Graceful degradation of jQuery event handlers

If you saw my post on SharePoint custom ribbon actions, you may have noticed the section where I had to lay out several options for jQuery’s persistent event handlers because I couldn’t know which version of jQuery the solution would be used with. Since I’ve written a few projects that are designed to be inserted into existing sites, I thought it would be a good idea to build a system to easily manage the graceful degradation of these handlers. How I did it

Tagged with:
Posted in Custom Library Functions, GitHub, JavaScript, jQuery