Nate Woods

Nate Woods
Technical Ninja

Optimize for the Web

In a world of broadband internet and fast hardware, optimizing websites and web applications can seem like a meaningless task. But what can the extra code you are sending your clients really cost? After reading In Defense of Optimization Work, I set out to revamp this very website, just to see how much cruft could be removed.

continue reading »

JavaScript Calendar

This simple script is derived from jszen’s blog. While he has done lots of great work, you will see my script has no use with double for loops. This greatly improves the speed at which this script can execute and simplifies the algorithm substantially. Also, I added the ability to scroll through the months, NBD.

continue reading »


Welcome to Jekyll!

You’ll find this post in your _posts directory - edit this post and re-build (or run with the -w switch) to see your changes! To add new posts, simply add a file in the _posts directory that follows the convention: YYYY-MM-DD-name-of-post.ext.

continue reading »

Actual Day 3: Update

For those that missed class last Thursday (the 23rd), Instead of going over “Day 3: While Loops,” we reviewed all the content up to this point (Chapter 1 and Chapter 2). Because of this schedule change, all the due dates have been pushed out until the end of this coming class period (Tuesday the 28th).

continue reading »

Homework Help - VL Chapter 1.6

Correct Change

1-6. Write a program to assist a cashier with determining correct change. The program should have one input, the number of cents to return to the customer. The output should be the appropriate change in quarters, dimes, nickles and pennies.

Hint: Consider how integer division \ and integer remainder Mod can be used as part of your solution.

continue reading »





Linux server issues: iNodes

When the df  command reports that you have plenty of disk space, yet you continue to receive several “not enough disk space” errors, your issue is probably with iNodes.  Verify this is your problem by seeing that the df -i command returns 100% usage on a particular drive.

For me, this usually occurs when an application creates a ton of small files in a single directory.  In order to find all these files, I started at the root with the command mentioned below and looked for the most files and drilling down and repeat.

continue reading »


Just got hacked + linux search

That was fun! Turns out somebody exploited two of my WordPress Plugins, which have now been restored or deleted.

This hack was luckily, mostly unsuccessful since the hacker(s) were script kiddies and couldn’t figure out how to make nsTView work on this system, rendering its remote management capabilities useless.  To be fair, they needed some smarts to navigate the WordPress system, but I have a feeling they just attacked with an auto-hacking script.

continue reading »

JavaScript Array Contains

Here is a quick one for you today.  Ever just want a simple way to see if there is an item in an array?  Well fear not, this little snippet is to the rescue!

Array.prototype.contains = function(x) {
    return (this.indexOf(x) > -1);
}
continue reading »

RC car to WiFi Car (Beginner Robotics)

When I was a senior in high school we (classmates) were asked to come up with a senior project.  Having always wanted to dabble with robotics and control systems I proposed the idea project of building a WiFi controllable RC car.  Our idea was simple enough, take an RC car, rip all the “guts” out, load with our custom build hardware and software.

Using a toy car as our base we soon found a multitude of problems at the time, most of which resulted from a budget of $0.

continue reading »

JavaScript Repeat a string

After writing writing my fair share of for-loops, I decided there must be a better way to repeat a string.  Personally, I found this solution to be very elegant and hopefully will help you as much as it helped me.

String.prototype.repeat = function(n) {
     return new Array(1 + n).join(this);
}
continue reading »

How to restart Google Chrome

Being an excessive tab user, I am often run out of memory on my machine. Realizing I need to close a few tabs (around 73) I do so, but that pesky flash memory just doesn’t want to be returned to the operating system. The only way to free the used memory would be to close chrome completely, and lose all the opened tabs. The other option is to wait for Google to push an update and use the ‘restart chrome to update’ option. This works sometimes, but like the rest of America, waiting isn’t really in my dictionary. Fortunately there is a way to restart the browser and save all your lovely tabs.

Simply navigate to chrome://flags/ (sorry no link, chrome doesn’t let you link to that page for security reasons).

continue reading »

Make your own Linux commands!

Have you ever wished there was a short Linux command for several lengthy piped commands, or even a script, that is often used? (Of course you have, lets be honest here!) Fortunately for you, there are two ways to do such a thing.

  • Create a command alias
  • Move a script to the /usr/bin directory

Either way, it would likely be a good idea to have administrative permissions. (Though not required in all cases)

continue reading »