Happy Chinese New Year and welcome to kourge.net, also known as korp, the online mind-dump of kourge. Here you can find various articles written, designs made and projects initiated by kourge, and of course other miscellaneous stuff as well.

History meme

It seems that a shell history meme is passing around the blogosphere. I first saw it on Dan Mills' blog post via Planet Mozilla. There are already 10 Mozilla hackers posting their top used shell commands, so I thought I'd do it too.

koeji:~ kourge$ uname -a
Darwin koeji.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 20
08; root:xnu-1228.4.31~1/RELEASE_I386 i386
koeji:~ kourge$ history | awk '{a[$2]++} END {for(i in a){print a[i] " " i}}' | 
sort -rn | head
88 ls
81 cd
28 cvs
26 rm
26 md5sum
23 ./firefox-bin
22 sudo
12 ssh
12 js
9 less

A few notes:

  • md5sum is actually md5 on Mac OS X. I aliased md5 so that I wouldn't suddenly have a hard time adapting should I start using a Linux system.
  • js is an alias of java -Xms256m -Xmx512m org.mozilla.javascript.tools.shell.Main, which is the command to invoke the Rhino shell, which I sometimes use when I write shell scripts in JavaScript. Rhino is an awesome JavaScript implementation in Java.
  • You can see from the cvs count that I'm slacking off recently when it comes to maintaining Drupal modules.

So, fellow Drupalers / Drupalites, what are your most commonly used terminal commands? Beware of the line break before sort -rn when pasting the command into your terminal.

Snippet: Font Detection with Prototype

This is essentially a clean house implementation of the font detection method described at lalit dot lab using Prototype 1.6. Another method described at maratz.com seems very interesting, since it uses Flash.

This is only usable after the DOM is ready. Call Font.detect with a string containing the name of the font to be detected. If it's detected as present, true is returned, otherwise, false.

Firefox 3, Now With Array Inconsistency

Alex Russell has pointed out that Firefox 3 has some quirky issues with JavaScript arrays, namely, an array made from a literal has a different constructor than an array made from instantiating the global array object. Long story short, the below is true:

[].constructor != new Array().constructor

Update

It seems like this is a Firebug-specific issue. If you try to evaluate the above in Error Console, you'll get false.

Kenpachi's Zanpakutō

If you don't read or watch Bleach, this post will seem like nonsense to you. Otherwise, read on.

DROP Continues GHOP's Beat

After the Google Highly Open Participation (GHOP) contest ended, we've got a huge influx of new contributors in Drupal. The positive influence the GHOP brought was truly amazing. To keep the beat rolling, DROP was created. Standing for Drupal Really Open Participation, we continue the goodness of a task-based system and pancakes.

This is a really brilliant idea. It serves as an incentive for regular contributors. It interests new contributors. It gives recognition. These are all successful traits of GHOP that DROP wishes to carry on. I've personally already claimed one task and plan to work on more once I have the first one cleared.

So what can you do to help? Read on.

Object Destructuring Shorthand: New in Firefox 3 Beta 3

One of the changes in Firefox 3 Beta 3, which has just been released, brings the object destructuring shorthand to JavaScript 1.8. Why would you need object destructuring in the first place? Commonly when you need to pull certain values out of an object structure, as demonstrated here. The introduced shorthand sprinkles a bit more of syntactic sugar into object destructuring assignments. Read on for concrete examples.

New Design: Xīnnián

With the arrival of Chinese New Year, I decided to make another design based on Zen and called it "Xīnnián." Xīnnián is Chinese for "new year" (新年), which is approximately pronounced "shin'nien" for those unfamiliar with Pinyin. Read on for explanations of various Chinese characters featured in this design.

5 Great, New Features in Drupal 6

With the release of Drupal 6 around the horizon, I made a presentation (as part of GHOP) that (attractively) outlines 5 new features in Drupal 6 that I deemed "awesome".

The following features are outlined:

  1. OpenID support
  2. Module update status
  3. Improved usability
  4. Alias filtering
  5. Internationalization

Get the presentation.

Comparison of CCK/Taxonomy Modules in Drupal

This is a cross-posting from a handbook page I wrote on drupal.org. It may or may not accurately reflect the latest revision; for the latest revision, please view the original handbook page.

"There is more than one way to do it." This philosophy isn’t limited to Perl; it generally extends to open source software itself. Likewise, there are four modules that are intended to integrate taxonomy fields into the Content Construction Kit (CCK) for Drupal; these modules have been identified to have similar or overlapping functionality. Below is a list of the 4 modules.

  • Content Taxonomy (content_taxonomy)
  • CCK Taxonomy Fields (cck_taxonomy)
  • Taxonomy Super Select (taxonomy_super_select)
  • CCK Taxonomy Super Select Ultra (cck_taxonomy_ssu)

This document serves to compare and contrast these modules in order to make it easier for site owners to choose one to suit their site development needs. The following issues are addressed for each module:

  • ease of installation and ease of use
  • list of any dependencies or companion modules associated with each module (CCK, Taxonomy, Views, API modules, externally hosted code, etc.)
  • features and functionality
  • pros and cons
  • list of access permissions
  • evaluation of the documentation/handbook (if any)
  • status of the most stable release (development, alpha, beta, official)
  • if it is still in development, an evaluation for its potential for successful completion
  • a brief examination of the its issue queues for any glaring or recurring problems

Spellify: How Not To Use Prototype

About two and a half weeks ago I wrote about jQuery being underutilized. That's nothing compared to Spellify, the absolutely perfect and horrendous example of how grossly unutilized Prototype is. Read on.

Syndicate content