Introducing Wufoo forms

Everyone is being hit by the poor economy and everyone is looking for new ways to increase revenue. Recently, I have received a number of requests with almost the same requirements:

Hey, I see an opportunity to do xyz, and all I need is something simple on the web to establish a trustworthy online identity. The site only needs to be simple, easy to use and has something like a contact form so my clients can get in touch with me, I don't need a database or something sophisticated because I understand it will be expensive.

How to:print output with desired formats in awk

I was leveraging the jQuery auto-complete plugin today and my client asked me if I can store all the major cities in the United States. I managed to find a list through wiki, however, it is a HTML table with 273 rows surrounded with HTML tags, my goal here is to get entire city columns, join with single quotes and a comma, then apply them to the auto-complete plugin.

Input:

Rank City State Population
1 New York New York 8,363,710
2 Los Angeles California 3,833,995

Desire Output:
'New York',
'Los Angeles'

Here is my approach:

wget en.wikipedia.org/wiki/List_of_United_States_cities_by_population
awk -v s="'" -v e="'," '{print s $2 e}' filename

The v argument gives you the ability to define simple variable and creates flexibility for automation.

Want to learn more about awk, read this awesome tutorial.

I later discovered an even better approach by relying on Jquery. I first include jquery by using an user script by joanpiedra

Refresh the wiki page to get Jquery included in this page, then I use the following JavaScript in Firebug to populate the data:

$("#sortable_table_id_0 tr td:nth-$("table tr td:nth-child(2)").each(function(){
   var t = $(this).text();
   console.log(t); 
});

Wow, all data gets populated in the firebug console. The rest will be simple copy and paste.

Update:

If you are a mootools fan, you can achieve the same goal with the same code, as long as you have injected mootools into the page, as introduced below:

$('#sortable_table_id_0 td:nth-child(2)').each(function(){
   var t = $(this).text();
   console.log(t); 
});

You will also need to inject mootools into this page, the following script, a slight modification base upon joanpiedra's user script:

// ==UserScript==
// @name          Mootools
// @namespace     http://www.joanpiedra.com/jquery/greasemonkey
// @description	  Play nicely with Mootools and Greasemonkey
// @author        Joan Piedra
// @homepage      http://www.joanpiedra.com/jquery/greasemonkey
// @include       *
// ==/UserScript==


// Add mootools
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://www.mootools.net/download/get/mootools-1.2.3-core-nc.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

How to: Set Up Google App mail for your site (on linode)

Problem: You are a linode user, or your host provider does not ship with a mail server, and you don't want to or don't know how to set up a mail server. Google app mail is will be a good, free and quick way.

How?
Considering you can easily find lots of step by step guides, I am posting my dns settings for you as reference:


Google App mail DNS settings

Automatically refresh file changes in Visual Studio 2008

Here is the scenario I ran into: I am working on a framework that does xml processing and generates various language outputs by applying appropriate transforms. I wrote a small class that reads an input xml and xslt, then generates output file.

builder.exe input.xml input.xsl output.ext

I put the following in the post-build event:

$(TargetDir)builder.exe $(ProjectDir)input.xml $(ProjectDir)input.xsl $(ProjectDir)output.html

What annoys me is every time the project is built and output file gets generated, visual studio asks you the same retarded question: "Do you want to reload the files?" You need to press "Yes" a few times.

The trick is:

Tools -> Options -> Documents -> Detect when files is changed outside the environment -> Check Auto-load changes, if saved. Big timer saver :)

^ Top of Page