Category: Programming (page 2)

29 Apr 2011

ReCaptcha Broken? Here’s the fix

Sometime recently ReCaptcha decommissioned its old API hosts: api*.recaptcha.net. The new API locations are at “http(s)://www.google.com/recaptcha/api”. If you rely on Zend_Service_ReCaptcha (or its form element), you’ll need to change some constants in Zend/Service/ReCaptcha.php:

[...read the post]
22 Apr 2011

Xdebug 2.1.1 for XAMPP OSX 1.7.3

xdebug-211-xampp-osx.tgz contains a freshly compiled xdebug 2.1.1 module for XAMPP OSX, using this tutorial as a guide. The archive contains step-by-step install instructions w/ bash commands. Happy debugging with fewer bugs.

[...read the post]
22 Apr 2011

Bash: Resolve symlinks in your working directory

Say you have created a symlink from your home dir to another location: $ ln -s /Applications/XAMPP/xamppfiles/htdocs ~/htdocs Now you can easily change to the XAMPP htdocs: cd ~/htdocs and then get back home: cd .. But how do you get to xamppfiles? Update: Thanks to sapphirepaw, the solution is simple: cd -P htdocs/.. or

[...read the post]
17 Apr 2011

How to Modify a 3rd-party Chrome Extension

I wanted to add a little feature to the Delicious Chrome extension, but couldn’t find any reference to how to edit/clone a 3rd-party extension. It turns out—at least for making minor mods—it works how you’d think: Change some extension files. Restart Chrome. Caveat: Undoubtedly an update of the extension would wipe out these changes, and following

[...read the post]
16 Apr 2011

Shibalike: a PHP emulation of a Shibboleth environment

Update 2011-06-23: All the essential components of Shibalike are complete and the project is hosted on Github. This is currently blueprint-ware, but I’m excited about it. A co-worker and I have laid out a design for a flexible system that can emulate a working Apache/PHP Shibboleth stack, without requiring any outside resources (e.g. an IdP,

[...read the post]
12 Apr 2011

EA Skate started as a text game

EA’s Scott Blackwood talks about prototyping the flick-it controls for EA skate. But we really liked it on paper. We worked with our lead programmer at the time, and really, in about two or three days, he built a prototype, and it was great. We actually were up and playing the game — no rendering,

[...read the post]
1 Apr 2011

Designing a Contextual Role-Based Capability Control System

Update May 2: ScopedRole is now a PHP5.3 library based on this design and is passing initial unit tests! After surveying a few permissions models that one might want to choose for an LMS, I think Moodle really got right the notion that role-based permissions should be flexible depending on the domain(s) the user’s in.

[...read the post]
1 Apr 2011

Programming is…

Myth: Programmers get to write code all day. Truth: Most programmers spend a ton of time (in no particular order): Carefully composing e-mails to other programmers/mailing lists/non-technical folks Sitting in on meetings, working on mockups and DB schemas, worrying about performance implications of proposed features Writing bug reports and searching through bug DBs Scrambling to

[...read the post]
16 Feb 2011

IE6/7 CSS Specificity Bug

After our team launched the new College of Education site, I discovered that IE8′s handy “Browser Mode: IE7″ mode of IE8 is useless for real IE7 testing (but IETester actually works!). Undoubtedly this “IE7 mode” has many quirks in its emulation we’ll never know about, but after a few hours of hair-pulling I finally pinned down a

[...read the post]
2 Feb 2011

Filtering WordPress Navigation Menus

WordPress 3 introduced native navigation menus, usually created via the wp_nav_menu theme function and the built-in Custom Menu widget.  If you have a menu with a deep hierarchy, you may want to display only the active branch and the submenu directly below the active item (given class “current-menu-item” by WordPress). You can see this menu

[...read the post]
25 Jan 2011

Simpler API for Zend’s built-in Firebug Logger

Zend Framework has functionality to send messages to the Firebug console (via Firefox’s FirePHP addon), but if you’re not using the ZF front controller, the API is a bit of a pain. Besides your instance of Zend_Log, you must keep track of a few additional objects just to manually flush the headers after all your

[...read the post]
24 Dec 2010

Gainesville: PHP/Javascript Developer Position Open

The Office of Distance Learning is seeking a web programmer with considerable experience with PHP, Javascript, and SQL to aid in the creation of and maintenance of several web and mobile applications. The person we’re seeking will need a strong understanding of and experience with: PHP5 Javascript object-oriented and functional programming styles related technologies such

[...read the post]
8 Dec 2010

Closure Compiler is smarter than you

I’ve known about Google’s Javascript minifier, Closure Compiler, for awhile, but after sending a couple snippets through it today I realized it’s a pretty impressive piece of work. Input: function howManyMatch(arr, pattern) { var l = arr.length; var total = 0; var i = 0; for (; i < l; i++) { if (pattern.test(arr[i])) {

[...read the post]
21 Nov 2010

Customizing a Zend Navigation Menu

Zend Navigation has a menu helper class that can output a basic nested UL menu. You can set id/class attributes on the A elements, and it adds an “active” classname to A elements in the active branch, but customizing the markup beyond that gets complicated.

[...read the post]
18 Nov 2010

?YouWontSeeMe

In beta 11, Opera’s going to hide all “http(s)://”, and also all querystrings (until you focus the addressbar). Opera’s devs are right that users consider them mostly “gibberish”, but I think this change could cause a ton of problems and confusion for people, especially support staff, and there are plenty of sites/apps still out there

[...read the post]
17 Nov 2010

We need a frontend design tool for live web pages

It’s quite frequently that an HTML/CSS designer might want to make changes to a live web page. Maybe she doesn’t have write access, or maybe the fixes needed aren’t worth the start-up cost of copying the page locally and working on it there, or multiple designers want to work up ideas on a given page

[...read the post]
14 Nov 2010

E-mail Address Munging Still Mitigates Harvesting

At least a decade into the use of simple e-mail munging on web pages (my own solution here) there’s a growing consensus—and it seems like common sense with the advancement of the web in general—that this surely can’t still work on modern harvesters. While trying to look up some old research I’d read about this,

[...read the post]
14 Nov 2010

Using jQuery Before It’s Loaded

It’s better to include scripts like jQuery at the end of the BODY, but this makes its methods inaccessible earlier in the page (e.g. inside a WordPress post). What you can do is use a script like the one below to queue DOMReady functions before jQuery loads. (function (w) { if (w.$) // jQuery already

[...read the post]
14 Nov 2010

Tiny E-mail Munging Script

I’ve seen a lot of these that are bloated/less effective/inaccessible, so I might as well put this out there. It’s simple enough to modify if you’re comfortable with Javascript. Markup: <a href=”mailto:john{@}example{.}org”>john{@}example{.}org</a> (function(){ var a, i = 0, o = this.onload; onload = function(){ o && o(); // run the old window.onload if existed while

[...read the post]
3 Nov 2010

Perks of Life in the Kingdom of Nouns

Execution in the Kingdom of Nouns is one of Steve Yegge’s most entertaining posts about the verbosity and noun-centricity of Java (and other strongly typed languages without first-class functions). His post paints a picture of life outside JavaLand, where things are simpler and more straightforward: There’s rarely any need in these kingdoms to create wrapper

[...read the post]