Pointless Chat Demo 2

Getting up and coding

View all posts in this series

We have our source control repository setup. Now it is time to get our machines ready to write some code. That means installing some tools.

Love thy terminal

We are going to be spending some quality time with our terminal. If you are a typically Windows user, this might be a tab bit scary. It’s okay. We’ll give you some love shortly.

I use a Mac at home, so I’ll mostly focus on that platform. If you are running Linux, you are a smarty pants and you can figure things out for yourself. I’ll give you Windows users a push in the right direction shortly.

On the Mac, I like a terminal replacement called iTerm. It’s got some nice features, and supports tabs.

Some windows love

Okay, Windows users, let’s chat. First, it’s cool. You are in a safe place here. Nobody is laughing at you or calling you names. You’ll be happy to know that most everything just works when it comes to Node development on Windows. Really.

There are some neat tools just for your platform too.

  • chocolatey: A package manager. Like apt-get for Windows
  • posh-git: A nice set of Git extensions for PowerShell.
  • ConEmu: A slick console emulator.

My instructions will tool installation will be focused on the Mac, but you can easily figure out how to get your machine setup.

Relax, have a Homebrew

Back on the Mac, there’s a super simple way to manage the installation for our dev tools. Homebrew! If you don’t have it installed, do it now. You can install it by pasting the following command into a Terminal window:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

You are welcome.

Your tools

To work on our project, we will start out with three tools: Git, Node, and a Text Editor.

You can install Git via Homebrew:

brew install git

You can also install Node with Homebrew:

brew install node

Text Editors are mostly a personal decision. Hell, if you are sick in the head, you could even use vim . I lean more towards the full-featured IDE side. Hence, I use WebStorm by JetBrains. It is awesome and inexpensive. Or, you can checkout TextMate 2 or Atom.

Clone it!

Now we have everything we need to do our thing. Let’s copy our GitHub repository down so we can get working next time. To do that, just go to your terminal and type:

git clone git@github.com:isnotnil/pointless-chat-demo.git

Please remember that git clone will automatically create a directory for your repo. In this case, the directory will be pointless-chat-demo. So make sure you run this from the directory that you want to be the parent of the repository directory.

Okay, that’s all for today. Up next, we’ll stand up a simple web server in Node using express.

Pointless Chat Demo 1

Source Control

View all posts in this series

View the code for this post

If the plan is to have a bunch of source code, we are going to need a place to store it. The default place to store your code these days is GitHub. This is especially true for open source projects.

Now, getting Git and GitHub setup is a problem that has been covered by other people. A lot. I’m not going to do it again. I’ll just link to some.

Let’s setup the repo

First, I’ll need to create a repository, or as the cool kids say, a repo. To do that, I’ll mash on the green New repository button on my GitHub home screen.

New Repository

I’ll give my repo a clever name. I can also pick an intelligent default gitignore file based on the language you are using, and an open source license license. I’ll pick Node and the MIT License. Doing this adds a few files to your otherwise empty repo.

Repository Detail

Bringin’ some flow

Now, I could just start writing code like an animal. But that’s crazy. Let’s do something to bring some structure to our repository. I like Git Flow. In summary, we’ll be dealing with a few key branches.

  • master: The master branch is the production ready version of the code. It should be deployable at any time. You usually tag this branch for each release.
  • develop: This contains the latest changes. It’s less of a place where you write code, and more of a place to do integration and stage changes before you merge them up to master.
  • feature branches: These are temporary branches where you do your work.

We will create our develop branch right inside of GitHub.

New Branch

We will also go into our settings and make this branch the default branch. This will help prevent me from spacing out and accidentally commit code directly to master.

Settings Default Branch

Tag! You are it

I want to get in the habit of tagging my repository at the state it was for each post. For this project, we’ll consider each post as a release, so we’ll tag the master branch. Like everything we’ve done today, we go do this right from GitHub.

First, use the releases link on the repository home page.

Release link

Then, whop on the Create a new release button. I’ll fill out some details, and then publish the release.

First Release

You can check out the tag/release in GitHub!

That’s it. Our repository is ready to rock. Up next, we are going to get our development machine ready to go.

Pointless Chat Demo 0


View all posts in this series

Every year I speak at the career day event for the intermediate school where my wife teaches. I’ve been doing this for a few years and I’ve been using the same slide deck each time. I end my talk with a short technology demo, in which I rapidly build a crappy magic 8-ball application for iOS. It works, it gets my points across, I’m good at it, and it takes me barely any time at all to prepare for it.

It also is starting to bore me.

This year, I’ve decided to do something new. I’ve really gotten into JavaScript, specifically Node.js and Angular. I once gave a quick chat demo using socket.io to some co-workers, so I figured I could do something along those lines.

Then I had another, bigger idea.

Why don’t I make this a series of blog posts, where I build a pointless chat application. I can cover the whole life cycle, from starting a new project to getting it up and running on a server. I can open source the whole thing too, just for kicks.

So, that’s what I’m going to do.


Notes for my talk: Practical Powershell for Developers

I’ve uploaded my notes for the talk.  There’ aren’t exactly in a great format.  It is more like a stream of consciousness.  However, if you dig through it, you’ll find some interesting gems.

Download Notes

Thanks again to everybody who came to my talk. I had an absolute blast with all of you!

Hey! I’m speaking again!

I’m speaking again at the Central Ohio .NET Developer’s group on April 25. I’ll be talking about MSMQ, one of my favorite topics.