Copyright Assert Truthy

I was poking around in the newly open-sourced Etherpad code, and came across this tidbit.

/**
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

function assertTruthy(x) {
  if (!x) {
    throw new Error("assertTruthy failure: "+x);
  }
}

That’s trunk/etherpad/src/etherpad/testing/testutils.js by the way. So anyhow, as much as I appreciate that is licensed under the Apache License, is “assertTruthy” really creative enough to be worthy of a copyright?

Continue reading “Copyright Assert Truthy”

Fun with AutoHotKey

I’m rather fond of the e text-editor. Coming from TextMate, e presents a familar environment for Windows users. The one beef I had though was the inability to configure keyboard shortcuts. Specifically, I felt Ctrl+G should be “Find Next”, like it is in so many other programs, instead of “Go to Line”.

I tried a few other editors, but they all annoyed me to no end. Habits, familiarity, and all that. So rather┬áthan wait for e to add it’s own configurable keyboard shortcuts or muck around the in source code (brief aside: the availability of the source code actually makes me pretty happy — it means I can compile an alternative to vim / emacs on *nix that I actually like), I decided to use AutoHotKey.

In short, AutoHotKey lets you write scripts that remap keyboard shortcuts as you see fit. Some (minor) programming ability required and the documentation is a little convoluted, but it still beats all the alternatives. My e remapping below the fold.

Continue reading “Fun with AutoHotKey”