Posts concerning JavaScript

More Slate Tweaking

23:38 11 Aug 2013

Following last week’s post, this is about my progress using the OS X window manager Slate. My primary objective is to be able to define a set of window layouts for specific tasks—such as writing a blog post—and then easily invoke them. This is more difficult than it sounds, but I’ve more or less made it work.

Permalink     Comment     [, , , , , , ]    

Yak-Shaving with Slate

22:36 04 Aug 2013

Slate is a window management tool for OS X that I’ve been playing with recently. It’s open source, it has JavaScript bindings, and it’s extremely useful if, like me, you’re particular about setting up your digital workspace.

However, in part due to restrictions in OS X, it’s not as useful as it could be. I had intended to write a post about how I’d made it do a variety of nice things, but that will have to wait until next week.

Permalink     1 Comment     [, , , , , , ]    

Guide to How the Web Works I: For Web Users

22:47 28 Jul 2013. Updated: 13:47 01 Apr 2015

What I think every web user should know about the technical side of the web. This is intended to be the first in a series of guides aimed at increasingly advanced levels of use[1].

This post covers the basics; enough so that after reading it you won’t mistake a blog post for the new Facebook redesign.

This is a work in progress. Please let me know if you see errors, or if you don’t understand something here—that’s valuable feedback!

Permalink     1 Comment     [, , , , , , , ]    


21:32 26 May 2013

LESS is the name of a stylesheet language that “compiles” to CSS. It’s been around for a while, as have similar projects such as Sass. I finally decided to start using it today, prompted by fairly common issues with CSS repetition. Even though the project I used LESS for is quite small—a little under 1,000 lines of CSS—it made an immediate difference.

Permalink     Comment     [, , , , , , ]    

What I Want From “Bookmarks”

23:50 09 Dec 2012

I mentioned last week that I wanted to work on “better bookmarking” as my next coding project, basing my approach off of my own thoughts and recent Mozilla research. Now I want to examine what that project might be like.

Permalink     4 Comments     [, , , , , , ]    


23:42 02 Dec 2012. Updated: 21:04 03 Dec 2012

I wrote a JavaScript utility that lets you create a rectangle on a web page by dragging your mouse cursor, and then toggles the state of all checkboxes under the cursor. If you’ve ever had to deal with forms that have lots and lots of checkboxes, you’ll know why I decided such a thing was necessary.

Permalink     1 Comment     [, , , , , ]    

Blog Features I Want

22:44 11 Mar 2012

A discussion of common and custom blog features, and candidate applications that might provide them.

Permalink     2 Comments     [, , , , , , , , , , , ]    

jQuery Plugin: Chosen

21:13 25 Jul 2011

I often come across unwieldy select elements, and it’d be awesome if every site used Chosen to make them more usable. In fact, I should probably look into using GreaseMonkey to make Chosen ubiquitous for me.

Permalink     Comment     [, , ]    

jQuery Project

23:36 21 Jan 2010

I’ve been a big fan of jQuery more or less since it came out, and I’m happy to see the launch of The jQuery Project. I’ve used jQueryUI a couple of times and find it fairly useful; I haven’t tried Sizzle yet but it looks great for situations where you’re really concerned about keeping file sizes low but need decent CSS selector support; and I wish QUnit had been around when I was writing a lot of client-side code.

Permalink     Comment     [, , ]    

Some JavaScript Programming Patterns

15:09 11 Oct 2009

“JavaScript Programming Patterns”, by Klaus Komenda, is an excellent walkthrough of several JS patterns. If you code JavaScript regularly you probably know at least some of these but will likely still find something useful in it—I particularly like the lazy function definition, a pattern originated by Peter Michaux:

var foo = function() {
    var t = new Date();
    foo = function() {
        return t;
    return foo();

Simple, elegant, solves the problem of making sure that the heavy lifting only gets done once.

Permalink     2 Comments     [, , ]    

Python Syntax Highlighting for star-light

23:37 26 Jun 2009

A couple of years ago I plugged star-light, a syntax highlighter that’s entirely client-side. I’ve been happy with it, but wanted a Python mode for it. I was going to post some other code this evening, and then decided that I should just make the Python mode myself.

This led to fun with regular expressions.

Permalink     Comment     [, , , , ]    

jQuery Sparklines

19:40 22 Jan 2009. Updated: 16:47 28 Jan 2009

I really like this jQuery sparklines plugin. I’m not sure what uses I can find for it right now, but my books/week or books/month reading rate, something like lines of code written or changed per day, the page counts of recent books, or recent MTG results would all work with it. Some of those things would be better expressed with full-size graphs using Flot, though. But while I don’t have a use case right now, this seems like a tool worth having in the toolbox (especially since it’s free).

Permalink     Comment     [, , ]    

jQuery Improvements

23:59 13 Jun 2008. Updated: 07:40 14 Jun 2008

Recently I’ve been noticing once again how useful jQuery is, and wondering how I ever did DOM manipulation without it. It’s been a while since I’ve really looked at the release notes, but the latest version (1.2.6) has some significant improvements in it.

Permalink     Comment     [, , ]    

Coding and Concepts: Tiebreakers

23:56 04 Feb 2008. Updated: 08:56 05 Feb 2008

While working on the tournament runner application that’s part of the ongoing rewrite of sfmagic.org, I encountered a problem which I think is indicative of how important ways of viewing problems are for coming up with solutions, especially in programming.

Permalink     6 Comments     [, , ]    


23:57 29 Jan 2008. Updated: 23:05 25 Mar 2008

Date handling in JavaScript sucks. It’s quite astonishingly bad, in fact, and I always think that I’m forgetting to do something when I try to use it—but no, it appears that the major JavaScript developers have never pushed a robust date object. I’m not sure why, as the Web’s international nature seems to make that more important, not less. On top of which the browser should really tell the server what time zone it thinks it’s in, but that’s another story. Anyway, there’s a library I’ve been looking at, and which we’re apparently going to use at work, Datejs (available at datejs.com).

Permalink     3 Comments     [, , ]    

Some Minor Software Projects

14:37 27 Jan 2008. Updated: 23:14 28 Jul 2009

I already have a buch of plans for larger projects, including finishing the sfmagic.org rewrite, but I think it makes sense to have some smaller projects to work on as well, things that I can switch to and make significant progress on in a relatively short amount of time.

Permalink     1 Comment     [, , , , , ]    

sfmagic.org Rewrite: Pod Division

23:45 21 Jan 2008

Individual draft groups in MTG are called “pods”. The sfmagic group runs drafts every Wednesday (19:30, Milano’s Pizzeria), and it’s these drafts that I’m rewriting a site to track the results of. At the moment I’m writing the data entry side, and took a slight detour to write a utility to help in the weekly organization.

Permalink     Comment     [, , ]    

sfmagic.org Rewrite: Planning Data Entry

23:52 15 Jan 2008. Updated: 01:33 16 Jan 2008

Sadly, I’m not quite going to finish a drop-in replacement for the current sfmagic.org codebase by my deadline of tomorrow. I’m close, and I think I have everything except the data entry portion, which I’ll lay out in this post.

Permalink     1 Comment     [, , , ]    

sfmagic.org Rewrite: Stalled/Graphs

23:46 08 Jan 2008. Updated: 01:54 09 Jan 2008

I didn’t have much time to work on the rewrite today, and spent what time I did have messing around with graphs.

Permalink     Comment     [, , , ]    

Leaving Nimblefish

23:45 23 Apr 2007. Updated: 18:54 24 Apr 2007

Today I told Nimblefish I was leaving. My last day is 4 May, Friday after next.

It’s rather weird to be leaving. I’ve been there for almost five years.

Permalink     Comment     [, , , ]    

AJAX Cross-Site Scripting with Apache RewriteRule

23:48 16 Apr 2007. Updated: 10:22 17 Apr 2007

AJAX has a significant limitation: for security reasons, it can’t fetch data from sites other than the one the user is on. This makes a number of cool things much harder to do.

One way around this is the script tag hack. But that requires a third party that outputs JavaScript files, whereas what I want is to be able to process XML and/or HTML from that third party.

Permalink     Comment     [, , , , ]    

Checking for position:fixed Support

23:57 29 Mar 2007. Updated: 07:13 30 Mar 2007

The CSS fixed value for the position property is extremely useful, particularly in allowing for persistent navigation on long pages. Naturally, versions of IE before 7 don’t support it. I’ve been getting around that using JavaScript.

Permalink     1 Comment     [, , ]    

DOM ‘Live’ Iteration Gotchas

23:17 24 Mar 2007. Updated: 23:45 25 Mar 2007

When you’re manipulating the DOM and are working with elements through list or array iterators, it’s important to remember that the arrays/lists are “live”—otherwise you’ll end up spending a lot of time trying to figure out why your code is, for example, skipping nodes.

Permalink     Comment     [, , ]