Wednesday, November 9, 2011

How to Unstick a Stuck Mac App Store Download

Periodically you may try to install/download/update an app in the Mac App Store (MAS) and it will sit there "waiting" indefinitely. Restarting the MAS doesn't seem to help. What did work for me was the following:
  1. Quit the Mac App Store.
  2. Navigate to /Applications/Utilities/
  3. Open Activity Monitor.app
  4. Search for "storeagent".
  5. Select it, choose "Quit Process".
  6. When asked if you really want to quit the process, choose "Quit".
  7. Open the MAS and try to download the app again.

Note: Before you do this, you can also try holding Option, and it will give you a chance to "Cancel" the download, but this didn't seem to fix the issue for me.
Tuesday, June 28, 2011

Adventures in changing the black navbar in Google

Adding the following user styles to your browser should get it looking clean again:

Make black navbar white and remove navbar's bottom border:
#gbx4 {
background-color: #fffffff;
border-bottom-width: 0px;
}

Make the top text black again:
#gbg .gbgt {
color: #fff!important
}

Make the selected item black again:
.gbz0l .gbts {
color: #000;
}

Also, the settings icon for a white background is part of this:
http://ssl.gstatic.com/gb/images/b_8d5afc09.png

This isn't everything, but it's a start. Any comments and thoughts are appreciated!
Tuesday, May 3, 2011

Konami Code Javascript implementation

I developed this to navigate my site with various shortcuts. My specific implementation can be seen here, and allows various keypress sequences to go to different pages (try typing "home" right now, for example).

What makes this code unique is that there is no ever-increasing array to check against, thus keeping the runtime memory free as can be. It is also extremely flexible and allows for many codes with no slowdown and minimal tweaking (see my linked code above).

Note that this is not tested with Internet Explorer and likely does not work in said browser.


if (window.addEventListener) {

  //konami keypress code, plus as many other codes as you want
  var keyCodes = [[38,38,40,40,37,39,37,39,66,65]];

  //corresponding page(s) to load if the code is correct
  var urls = ["http://www.lotsaoxen.com"];

  //tracks state of keypress (starting at 0)
  var states = [];
  for (i=0; i<keyCodes.length; i++) states[i] = 0;

  window.addEventListener("keydown", function(e) {

    for (i=0; i<keyCodes.length; i++) {
      //if the most recent keypress matches, increment the corresponding state,
      //otherwise reset to zero
      if (e.keyCode == keyCodes[i][states[i]]) states[i]++;
      else states[i] = 0;
      //if the state matches the array length, go to page
      if (states[i] == keyCodes[i].length) window.location = urls[i];
    }

  }, true);

}