Development


23
Nov 10

How to learn Node.js from Scratch

Server-side Javascript has appealed to me for quite a awhile, and while watching from the sidelines was interesting, I still never had the time to really get my feet wet and see how the language really worked. That changed after joining Joyent, of course. We’re the proud home of Node.js, and it would be wrong unforgivable if I didn’t know how to write JS.

It turns out that learning Javascript has been quite fun, and really easy. There are numerous resources on the internet for learning how to manipulate the DOM, and do ridiculous stuff with JQuery. But I’ve never been a UI person. I’m a server and network guy, through and through. It turns out, the hardest part about learning Javascript is finding decent documentation. Most of my learning experience has been through reading other peoples wacky, sometimes incomprehensible code, and then going through lists of tutorials that I wrote for myself. Breaking things seems to be the best way to learn how to write stuff. I also was able to rely on some of my brilliant co-workers who are full time software engineers.

Here’s a list of resources I found helpful, which don’t necessarily show up at the top of your Google search results.

NodeTuts

A decent list of tutorials as screencasts. They can be a little on the long side, but there are a few gems. Check out the one about learning how Sys.pump (util.pump) works. Once you understand how it works you’ll kind of be blown away at how easily you wrote something so powerful

Node.Js Documentation

The API documentation for node is extremely well written, a testament to Ryan’s Benevolent Dictator for Life mentality, which is a really good thing.

Crockford on Javascript

Douglas Crockford has a ton of really well written examples, standards, “best practices”, and videos. If you’re interested, check out “Javascript – The Good Parts” post, hosted on the Yahoo! developer network (Mirror please…)

Mozilla Developer Network Javascript Reference

I don’t know why this wasn’t the first result I found when I searched for things like “Javascript Object” or “Javascript Array”, but this is the best resource that explains what the native objects are, what methods they include, and provides some decent examples on their usage. A MUST read.

Learning Advanced Javascript

John Resig is putting together a book on the Secrets of Javascript, and it has something to do with Ninjas. But this part of the book is available for people to read today, and it’s pretty cool. After you nail down a lot of the style, prototyping, and closure stuff, be sure to check out this list of examples on advanced JS.


12
Feb 10

Unfuddle Git Backups – How to Actually Use Them

I really like Unfuddle. The service is easy to use, and there are a lot of great features in there. The documentation is… lacking, however.

One of the things I like is the ability to get a full backup of all my project data, repositories, etc in a single tarball. You can even ask them to keep a copy in your own S3 account.

To create a backup do the following

1) log into Unfuddle and goto the Project page.
2) Click the ‘settings’ tab then
3) Scroll down till you see link that says ‘Request a backup of this project now’ link. Click it.

In a few moments you’ll get an email, and you’ll see a new link on the right hand side of your project settings page that includes a timestamped backup. This backup is a tarball that contains all the GIT repositories and some other files like a backup.xml file which looks like all your tickets.

To use the git dumps run the following

mkdir reponame
cd reponame
git init
git fast-import < ../my-unfuddle-backup.git.dmp
git checkout master

You’re done!

If you’re using subversion repositories there is documentation on how to use these repo backups on Unfuddles website.


2
Sep 09

How to get Started in Vancouver Tech

I’ve been meeting quite a few people who are new to Vancouver and are looking to get involved in the local Web and Tech scenes. There’s quite a bit going on, and Google is your friend, but if you want to save some time here are the best places to go, meet people and see what’s going on. There’s also a score for how nerdy or business-y (?) the event is on a scale of 1-10.

Do your research

Nerdy: 5
Business: 4

Find out what you’re interested and search for companies based in Vancouver that do what you love. If you’re enthusiastic people will make time for you. Ask someone out for coffee or a pint and just talk. Don’t try and get a job, just figure out what’s going on. Like any “scene” you’re likely to hear conflicting viewpoints. Keep an open mind. Look for and talk with local bloggers and tech reporters. Look for events happening in your area. If you’re interested in Open source projects, find out if the people who work on them are in the area.

Democamp Vancouver

Nerdy: 7
Business: 5

Like most unconferences, Democamp is a loosely organized evening event where the people that attend make up the conference. In this case you bring an idea, and the idea is your demo. You don’t have to present, and it’s a good way to meet people that are interested in starting something new, or are working a project already. Democamp doesn’t happen nearly as often as it should, so if you’re interested in helping out there, check out the site and get in touch.

Launch Party Vancouver

Nerdy: 4
Business: 8

Every few months local entrepreneurs who are launching their projects meet up to celebrate all their hard work. Walk around and talk with people and get to know the people behind these projects. Most of the time the executives are presenting but ask to chat with some of the developers if that’s more up your alley. This is usually a very social event where you’re bound to meet a lot of interesting people – just don’t be shy.

Bootup Labs

Nerdy: 8
Business: 6

Bootup Labs is a local startup incubator which helps companies go from “zero to fundable”. The offices are located at 375 Water St, in Gastown and house a rotating group of Vancouver based startups which are always looking for talented help. Bootup has an open door policy so if you’re new to the area you can generally just pop in, but I suggest getting in touch with them first to arrange a quick (<30 minute) chat. Everyone is really friendly, and it’s a good way to plug in, or at least get pointed in the right direction.  Bootup helps run a few of the events in town, so pay attention to their upcoming feed for things that are happening

Techvibes

Nerdy: 5
Business: 5

Techvibes is a tech community blog and business directory. It’s a really good way to get to know which businesses are in the area and what they do. They also publish a list of events happening in town that range from an Entrepreneurial to Developer focus.

VEF

Nerdy: 2
Business: 10

If you’re more into the business and entrepreneurial side of things, I suggest checking out Vancouver Enterprise Forum or VEF. VEF hosts events on a monthly basis and it’s a great way to connect with other like-minded individuals.

Developer Meetups

Nerdy: 10
Business: 3

There are plenty of developer meetups happening in town. The umbrella meetup for all of these is the VanDev network. Join that and you’re bound to meet quite a few people. The most popular is the Ruby/Merb/Rails meetup which has events on a monthly basis.

I hope that’s enough to get you started! Let me know if there’s anything else you want added to the list.


22
Apr 09

URL Shortener Statistics on Twitter

URL Shortening services have gotten a lot of attention because of Twitter. The reason is that most significant links on the internet are longer than 140 characters and that doesn’t leave you any room to actually say anything when you tweet. Twitter will shorten some URL’s for you using TinyURL, but what about all of the other services? What’s the state of the URL shortening service world on Twitter?

Of course, the best people to answer this question is Twitter themselves, but since they haven’t published anything, and I doubt they’re interested in spending time answering my almost academic question I decided to write a quick app to get the stats myself.

The Twitter API is gorgeous. I mean. It’s simple, easy to use, and it’s fast. I grabbed a list of all the popular URL shortening services from a few locations, cross-referenced them and came up with 36 “popular” services. The actual number of URL shorteners is pretty incredible. (Some of them even have long names like “shortna.me” WTF are you thinking?)

The process is simple – Search for the urls of the shortening services using the search API, then count how many hits you get. Repeat every 30 seconds or so. (There are other nuances – look at the code).  This sampling was done over a 3 hour period on Wednesday April 22nd between the hours of 8AM and 11AM Pacific.

Results

Twitter URL Shortening Statistics - April 22 2009

Twitter URL Shortening Statistics - April 22 2009

Issues

You can only return 100 search results at a time, which means if you see 100 results for your term, there are probably way more of them. The only way to get around this would be to search more frequently for that specific term. I tried doing that and was quickly throttled by Twitter. Suffice to say, TinyURL is still the dominant force here, but probably because of their Twitter integration. This really throws off the numbers. There’s a fine line between searching too often, and getting accurate results. Tests in the middle of the night showed that TinyURL had about 30% of the URL Shortening Service market on Twitter. I’m 99% positive that TinyURL numbers are way higher.

Things to do

Optimize the searching algorithm so it displays more accurate results.

Record the time, and see statistics over the course of hours, days, weeks. I can tell you off the top of my head that TinyURL usage is high all times of the day, where as bit.ly usage is pretty much a “waking hours” service, as most others.

Better Reporting

GitHub

The scripts are on GitHub. Go bananas. http://github.com/Trevoro/urihz/tree/master