Back in February of this year, I released a Greasemonkey Script that would modify the theme from the Hack A Day site so it was a little easier on my “old eyes”!

The script works by changing CSS and HTML elements after they have been received by my browser.

The good folks over at Hack A Day overhauled their theme last week which meant my old hack needed quite a few modifications so it would work as it had with the old site.

Just as before, I’m a Firefox user so I’ve only tested the script with Firefox, but it should work just fine with other browsers. Other Hack A Day readers reported that my previous script worked with Opera and Chrome.

To use the script, do the following:

  • Install the Greasemonkey extension (Firefox.. Tools.. Add-ons)
  • Save the script as hackaday.user.js
  • Restart firefox
  • Drag the hackaday.user.js script from your desktop to Firefox

A couple of items to be aware of:

  • I didn’t take the time to test each of the previous modifications to see if they were still being used. That means the code could be tightened-up a bit, but it works just fine as is. If you care to take the time to test each of the old changes to see if they are still required, please do so and let me know your findings and I’ll update the code listing below.
  • I’m using a different logo image in my header (see screenshots) than the logo that Hack A Day is using. If you choose to use your own image, you’ll need to modify the link in the code. I don’t have permission to share my image, so don’t ask!

For more information on my original hack, please read my original post.

// ==UserScript==
// @name           Hackaday
// @namespace      http://localhost
// @description    Re-Theme hackaday.com
// @include        http://hackaday.com/*
// @grant          GM_getValue
// @grant          GM_setValue
// @grant          GM_addStyle
// ==/UserScript==

// Let's change the body background to white
document.body.style.background = "#fff";

// Let's set our link hover, heading3 and paragraph settings
GM_addStyle("a:hover {background-color: transparent; border-bottom:0px;}");
GM_addStyle("h3 {color: #000;}");
GM_addStyle("p {color: #000; background-color: #fff; font-size: medium; line-height: normal}");

// Let's get rid of the border around the body text
GM_addStyle("#container {border-width: 0px;}");

// Change comment block backgrounds, colors and margins
GM_addStyle(".comment-body {background-color: #fff;}");
GM_addStyle("li.depth-2 {background-color: #fff;}");
GM_addStyle("li.depth-1 {background-color: #fff;}");
GM_addStyle(".comment-body {margin-left: 6px; margin-right: 6px;}");
GM_addStyle(".fn {color: #888;}");
GM_addStyle(".says {color: #888;}");
GM_addStyle(".cle h3 {color: #fff;}");

// Change the color of each link
var zElements = document.getElementsByTagName("a");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="red";
}

// Change the color of each blogroll block
var zElements = document.getElementsByClassName("statsclass1");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#959595";
}
var zElements = document.getElementsByClassName("statsclass2");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#aaa";
}

// Change the color of each sharedaddy instance
var zElements = document.getElementsByClassName("sharedaddy");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#555";
   zElements[i].style.color="#fff";
}

// Change the sharedaddy title settings
var zElements = document.getElementsByClassName("sd-title");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="#fff";
   zElements[i].style.marginLeft="6px";
}

// Change the color of the comment counts
var zElements = document.getElementsByClassName("cat-item");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="#000";
}

// Added on 06/11/2012
// Change images
var images = document.getElementsByTagName ("img");
var x=0;
while(x<images.length)
{
  if(images[x].src.indexOf("hackaday-logo.gif") != -1)
  {
    images[x].src = "http://use.yourownimage.com/hackaday-logo.gif";
  }
  else if(images[x].src.indexOf("tips1.jpg") != -1)
  {
    images[x].src = "http://use.yourownimage.com/tips1.jpg";
  }
  else if(images[x].src.indexOf("feed1.jpg") != -1)
  {
    images[x].src = "http://use.yourownimage.com/feed1.jpg";
  }
  else if(images[x].src.indexOf("store1.jpg") != -1)
  {
    images[x].src = "http://use.yourownimage.com/store1.jpg";
  }
  else if(images[x].src.indexOf("forum.jpg") != -1)
  {
    images[x].src = "http://use.yourownimage.com/forum.jpg";
  }
 
  x=x+1;
}

// Added on 11/21/2012 to account for 11/16/2012 Theme Changes
// http://hackaday.com/2012/11/16/the-new-template-has-arrived/

// Let's change the header bg color and image
GM_addStyle("body, p, select, textarea {color: rgb(0,0,0)}");
GM_addStyle("#header {background-color: rgb(255,255,255)}");
GM_addStyle(".header-image #title-area {background-image: url(\"http://use.yourownimage.com/hackaday-logo.gif\");}");
GM_addStyle(".header-image #title-area {width: 457px;}");
GM_addStyle("#header .widget-area {width: 450px;}");
GM_addStyle(".header-image #title-area {height: 130px;}");
GM_addStyle("#header {min-height: 130px;}");

// Let's tweak the menu-bar
GM_addStyle(".menu {height: 25px;}");
GM_addStyle(".menu a {padding-top: 4px;}");
GM_addStyle(".menu {background-color: rgb(160,160,160)}");
GM_addStyle("#nav .s {margin-right: 10px;}");
GM_addStyle("input {vertical-align: middle;}");
GM_addStyle("input.s {height: 12px;}");
GM_addStyle("input.searchsubmit {height: 18px;}");
GM_addStyle("input.searchsubmit {padding-top: 0px;}");

// Let's change the wrap DIV bg color
GM_addStyle("#wrap {background-color: rgb(248,248,248)}");
GM_addStyle("span.date.published.time {color: #000;}");
GM_addStyle("span.categories {color: #000;}");
GM_addStyle("span.tags {color: #000;}");

GM_addStyle("#tl_ad {background-color: rgb(248,248,248)}");
GM_addStyle(".sidebar .widget {background-color: rgb(248,248,248)}");
GM_addStyle(".sidebar .widget p {background-color: rgb(248,248,248)}");
GM_addStyle(".widget-area h4 {background-color: rgb(85,85,85)}");
GM_addStyle(".header-image #title {opacity: 0;}");

// Let's change the comment boxes
GM_addStyle(".odd {background-color: rgb(255,255,255)}");
GM_addStyle(".even {background-color: rgb(255,255,255)}")

// Let's tweak the category box
GM_addStyle(".widget_archive select, #cat {background-color: rgb(85,85,85)}");
GM_addStyle(".widget_archive select, #cat {color: rgb(255,255,255)}");

Following is a before and after image that shows the transformation.

Until next time – GEEK OUT!

~GT~

   

 

As a rule, I don’t help family and friends with their computer needs! That said, I make two and ONLY two exceptions to that rule, one of which is my Mom. A couple of weeks ago, she called me complaining that her laptop was randomly powering-down. I went over to have a look and decided the first thing to do was run a backup. A few minutes into the backup – BAM – no power … her laptop was “dead”. I made another three or four attempts to backup her data but each time the computer would loose power. She was already talking about buying a new computer and since the existing machine was about four years old, I agreed that new was a prudent choice.

When I asked how long it had been since she last backed up she told me it had been more than a year – YIKES!!! With hundreds of photos, email, documents and music at risk, I needed to find a way to save her data. My first thought was to remove her hard-disk and connect it to another computer via USB and just copy the data off. The problem with this idea was how to connect the drive! I recalled having a number of older USB drives in my hacking stash”. I decided that I would disassemble one of them and use its SATA-USB controller to connect the drive to the new laptop and simply copy the data to her new machine.

The drive I selected was a “Western Digital My Passport Elite 320GB”. This drive was perfect because the SATA-USB controller didn’t require any type of external power as it takes power from the USB connection to power itself and the drive. This would make it really easy to hook up for this temporary assignment. Now that I had my drive selected, I needed to take it apart. This is where things get tricky.

To remove the SATA-USB controller you’ll need a screwdriver and something you can use to wedge into the case as you slowly work your way around the unit prying the edges apart. I used a stack of vinyl stickers but business cards, old hotel room keys or something similar would work.

Use a screwdriver to slowly and carefully pry the edge open. There are a lot of snap-connectors that hold the unit together. Be very careful, or the case will break! Once you manage to get it open, slip in a card to hold the unit apart.

Continue working around the unit VERY slowly and methodically. In order to remove the drive and controller assembly, you’ll have to pull the case apart on both the front and back sides.

When you’ve managed to get around both sides of the case, it should look something like this.

Now slip the center drive assembly out of the case.

Before we can remove the drive and access the controller there are three screws that have to be removed. Mine had a specialized star head that I didn’t have a bit for. To get around this I used a small flat-head bit that I could seat into the screw-head instead.

Now slide the drive out of the tray. That’s the controller protruding from the end of the drive.

FINALLY we have access to the controller. To remove the controller from the drive, firmly grasp the drive with one hand and the controller with the other and pull the controller off of the drive.

With my controller in-hand, now I need to remove the drive from the old laptop so I can install the controller and copy my data.

Now I connect the drive to the new laptop via USB and I can simply copy the data.

Until next time – GEEK OUT!

~GT~

   

 

If you have regular web sites that you visit, I bet I’m safe in guessing that at least one of them has something about it that you wish was different. You know what I mean — a different background color, larger fonts, menus in a different location, etc.

That site for me is “Hack A Day”. I love to see what other hackers are up to, but reading posts on the site with their green and white, small point text on a black background is killer on my eyes.

The great thing about the way the web works is that the page formatting is delivered to the browser right along with its contents. Once I have it, I can do with it as I please. That means I can change colors, fonts and just about any other stylistic or functional element on the page.

I’m an avid Firefox user and use a plugin called Greasemonkey that allows me to execute javascript on any page I choose so I can make the page look and/or act the way I want it to. I’m not, by any means, a javascript expert but it was a cinch to hack together a solution that allowed me to completely reformat the “Hack A Day” site to a more color neutral theme that is much less strenuous on my eyes.

// ==UserScript==
// @name           Hackaday
// @namespace      http://localhost
// @description    Re-Theme hackaday.com
// @include        http://hackaday.com/*
// ==/UserScript==
 
// Let's change the body background to white
document.body.style.background = "#fff";
 
// Let's set our link hover, heading3 and paragraph settings
GM_addStyle("a:hover {background-color: transparent; border-bottom:0px;}");
GM_addStyle("h3 {color: #000;}");
GM_addStyle("p {color: #000; background-color: #fff; font-size: medium; line-height: normal}");

// Let's get rid of the border around the body text
GM_addStyle("#container {border-width: 0px;}");

// Change comment block backgrounds, colors and margins
GM_addStyle(".comment-body {background-color: #fff;}");
GM_addStyle("li.depth-2 {background-color: #fff;}");
GM_addStyle("li.depth-1 {background-color: #fff;}");
GM_addStyle(".comment-body {margin-left: 6px; margin-right: 6px;}");
GM_addStyle(".fn {color: #888;}");
GM_addStyle(".says {color: #888;}");
GM_addStyle(".cle h3 {color: #fff;}");

// Change the color of each link
var zElements = document.getElementsByTagName("a");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="red";
}

// Change the color of each blogroll block
var zElements = document.getElementsByClassName("statsclass1");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#959595";
}
var zElements = document.getElementsByClassName("statsclass2");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#aaa";
}

// Change the color of each sharedaddy instance
var zElements = document.getElementsByClassName("sharedaddy");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.backgroundColor="#555";
   zElements[i].style.color="#fff";
}

// Change the sharedaddy title settings
var zElements = document.getElementsByClassName("sd-title");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="#fff";
   zElements[i].style.marginLeft="6px";
}

// Change the color of the comment counts
var zElements = document.getElementsByClassName("cat-item");
for (var i=0; i<zElements.length; i++) {
   zElements[i].style.color="#000";
}

Following is a before and after image that shows the transformation.

If you’re not a Firefox user, it may still be possible to achieve these same results with your browser of choice. Run a few Google searches on how to run Greasemonkey Scripts in your favorite browser and chances are you’ll find a way to make it work

Until next time – GEEK OUT!

~GT~

   

© 2012 Geek-Tips Suffusion theme by Sayontan Sinha