Web services, XmlNode, and XPATH

I was writing a little web services app to help delete individual permissions from a site and thought about trying XPATH on the result to get what I needed. I had some trouble so thought I’d put together a small example for later reference.

Using undefined in JavaScript

Working with JavaScript can definitely be painful, but I always love stumbling across interesting and strange features of the language. I just found wtfjs.com which led me to these two answers on stackoverflow.

Relative Dates in JavaScript

I was developing an input form for a search when I came across the need to allow the user to filter items using a date range. I had two input boxes where the user could enter a start and an end date. For some of the most common date ranges, I decided to create links that could be clicked to auto-populate the start/end date textboxes. For example, searching for items that were created last week or last month. Using JavaScript’s Date object, I was able to put together some nice examples.

AutoIt3 script to auto resize windows

One thing that bugs me all the time is when a window¬†doesn’t remember the position that it was resized or moved to. Although it is more of a nuisance than anything else, I decided to write a little AutoIt3 script to automatically resize my Remote Desktop windows to be the certain place and size that I prefer them to be in.

Using Prototype's Element.insert

Strangely, Prototype’s documentation for Element.insert does not have any examples, so I cooked something up quick: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Template</title> <script type="text/javascript" src="prototype.js"></script> <script type="text/javascript"> Event.observe(window, 'load', function() { // Using Element.insert to insert after, before, top, or bottom Element.insert($('para1'), { before: "<p>This is paragraph zero.</p>" }); Element.insert($('para1'), { after: "<p>This is paragraph two.</p>" }); // notice we have to insert using the content container Element.