cooking, programming and everyday life xrado

Wednesday, April 07, 2010

Asparagus and potato

Scratched legs, a handful of asparagus and here's dinner for two.
Asparagus and potato
Ingredients: potatoes, asparagus, onion, salt & pepper and some fresh chives and rabish on top.

Thursday, February 18, 2010

Extract emails

I was doing research on possible customers and end up with the long list of names, contacts and emails. While i was thinking about how i'm gonna assemble the mailing, i came a cross the thought i'll have to collect them again and copy / paste each email to compose form. Ehhh. Then i got the idea how to pass this annoying task. A few lines of javascript and regex and i got a script that collects emails, remove duplicates, get them lower case and separated by commas. Perfect!
window.addEvent('domready',function(){
	$('button').addEvent('click',function(e){
		var emails = [];
		$('text').get('value').replace(/(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?))|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?)/ig, function(match){
			match = match.toLowerCase();
			if(emails.indexOf(match) != -1) emails.push(match);
		});
		$('text').set('value',emails.join(', '));
	});
});
DEMO  ...paste the text containing emails and press format button.

Sunday, January 17, 2010

Going freelance

If you don't already know I'm going freelance with the next month. I was thinking about this for a long time and now finally decided to start my own business and try it on my own. I made a checklist of things I'll have to do before the startup and one of top priorities was setup a portfolio.

Here it is, it's not much, just some screen shots and short description but i think enough to give you the feeling what i already dealt with and what are my experiences. It's temporary, just until i make my own business web site.
pages:  1   2