Monthly Archives: February 2015

Weekend project: Building a web chat application with Node.js

screenshot

I’ve been playing around with Node.js recently and taking some of the neat online lessons available through Nodeschool. One of the lessons involved streaming realtime data between the client and server using Socket.io.

This sounded insanely powerful and fun, so I took a break from the rest of the lessons and started playing around with Socket.io. They have a tutorial that explains how to build a simple, realtime chat application using its library in about 20 minutes.

I’ve uploaded the results of this little project to Github and you can view it right here. This little web app is more or less a result of tutorial and I’ve added some additional stuff as I played around with it:

  • Usernames!
  • Number of active users!
  • Display a list of all connected users!
  • Check for identical usernames and prompt for different name
  • Timestamps on messages!
  • Sanitizing user input!
  • Properly autolink URLs!
  • Detect if a link to an image is pasted in and expand!
  • Display welcome message on connect

All in all, it’s been a really fun learning process and has given me some ideas on how to use Node.js for future realtime applications.

Note: You can see this in action on Heroku. You’ll probably be the only one only, but hey! https://davechat.herokuapp.com/

Baseball Twitter: Fun with the jQuery and Twitter’s API

screenshot_redsoxThis past weekend, I played around with jQuery, JavaScript, and Twitter’s API to create a web app that displays realtime search results for various baseball teams. I figure this is particularly important since pitchers and catchers report in about 10 days! 🙂

Anyway, the goal of this project was to rapidly build out a web app that could search and parse publicly available data (e.g., tweets!) for mentions of particular baseball teams while using various jQuery and JavaScript libraries. I could see this app having potentially wider uses beyond baseball such as returning the latest tweets from an event or hashtag. It also gave me a chance to use various libraries and frameworks as well. I’m pretty happy with how it turned out.

You can see it in action right here and the source code is available on Github.

 

Making maps: Using Mapbox to display 5,000 Foursquare check ins

Earlier this year, I joined a group on Meetup dedicated to creating, analyzing, and talking about digital maps. It’s organized by the fine folks at #Maptime, who have an amazing enthusiasm for all things map related. It sounded like something that’s right up my alley, considering all the time I spend thinking about maps.

Last night was project night. All sorts of folks were there, working on complicated issues such as transit, land use, green space, climate effects. It’s kind of inspiring!

I went to focus on some less lofty goals — I just wanted to get some experience playing with a JavaScript mapping library created by a company called Mapbox. My goal was to get the library up and running and then use it to display some geo-encoded data from a service I happen to use a lot: Foursquare.

It’s no secret that I really like Foursquare — mainly for keeping track of our adventures far and wide. I found a helpful PHP library for converting Foursquare (and other social networking) data into GeoJSON, which is needed by the JavaScript mapping libraries. After a couple of hours of hacking around, I got something up and running!

Screenshot 2015-02-04 20.06.29Pretty neat stuff! I have some ideas on how to improve this and some additional data that I want to show in the future.

 

My first half marathon

This past weekend, I completed my first official half marathon after participating in the 32nd annual Kaiser Permanente San Francisco Half Marathon! The course was fairly flat and wound its way through Golden Gate Park and along Ocean Beach. You couldn’t have asked for better better weather or scenery! Overall, it was the perfect event for a new runner like myself.

My official result? 2:17:32. That’s kind of the nice thing about your first half marathon — any time is a new personal record. I’ve been training off and on for the last few months (and indeed, I could have trained more) and was hoping to hit 2 hours.

As it turns out, I was on pace to do it until one of my calves started to cramp up exactly half way through the race, forcing me to take a stretching break and limp through the remainder of the course.

dave_schumaker_half_marathon

That’s me at mile 8! via @kerryme.

That said, it was still a really positive and fun experience and it’s something I’d like to do more of! Which is good, because I signed up for the Oakland Running Festival in March. Oh, boy!

A couple things I learned:

  • I brought my own water bottle (mainly so I could eat some of the gross energy gels that I brought with me). Overall, I wasn’t too distracted by it — I had brought a disposable bottle just in case it was annoying and I needed to chuck it. However, I skipped a bunch of water stations at the beginning of the race since I figured I had water. Big mistake! I should have taken advantage of the free water and gatorade (and used it to time when I should have consumed the gels). As it is, I ran out of water at around mile 10.
  • The gels really helped! I had the Cliff Bar variety. While they were really thick and gross to consume, I really felt that they gave me energy and I didn’t really hit a wall until the last mile and a half or so of the race. More than anything, I was distracted about my tight calf!
  • Someone else had mentioned this to me in the past, but I basically found someone who was running at a pace I was mostly comfortable with and I ended up sticking close to them for the first 6 miles. Trying to keep up with him was kind of a fun game.
  • I also discovered the “awful truth about jogging that no one ever talks about.” Oh, man is it true!