Blog logoMatthew Lang

Web Development

A 4 post collection


Exploring alternatives to GitHub

 •  Filed under Posts, Github, Tools, Web Development

I've been a user of GitHub for a long time now. Ever since I started my career in Ruby on Rails I've had a GitHub account.

I'm looking again at alternatives to GitHub mainly out of curiosity. There's been some improvements to GitHub over the last few years and new features are gradually coming out but there are other options out there.

I did move some private repos to BitBucket a few years ago, but due to the lack of any extra features I moved these repos back. BitBucket just didn't have anything of added value that would keep me using it.

I tried GitLab a few months ago but I didn't really give it a fair go. I spent a couple of weeks using but I didn't really dig into it too much. I created my account there again to give it a try. I've been using it now for a week and I've moved a number of private repos over from GitHub. The nice thing is that as well as my repo GitLab has moved over my issue list for each repo. Another thing I don't have to worry about moving it across.

It's still early days to make a final decision on this but I've been impressed with not only what GitLab does at the moment, but the pace in which they are releasing new features.

The best thing and worst thing about GitHub is its community size. A lot of developers use only GitHub for source code hosting and although some people might see this as a good thing, it's like saying that Facebook is the only social network platform out there. Yes, there are a lot of people using GitHub but there are alternatives to it and I'm always willing to explore the alternatives to any development tool that I use.

Once I've spent another few months using GitLab I'll probably have a final decision on where I'll be hosting the bulk of source code. I won't be closing down my GitHub account if I do decide to use GitLab for hosting my source code. I still need a GitHub account for client work, but that's all it will be used for.

Scaling Back

 •  Filed under Posts, Tools, Web Development

For a long time I've wrestled with a number of different terminal apps and tools in the hope of improving my productivity at the command line. Initially I used iTerm2, a terminal emulator for macOS, as my preferred terminal app. Then I also started using tmux, a terminal multiplexer, on top of that. Then came along Vim, the open source text editor, and I started using that as well.

This was the first time in a long time that I had started using all three again. The benefit of using this combination of tools is that I could run both my command line and text editor within a single app and very rarely have to switch away from it.

One huge pain point I couldn't get round though was the simple act of copying and pasting text between Vim and other apps. Despite a number of attempts to get it working I've decided to call it a day on this trio of tools.

  • Vim is a great text editor, but to be honest I'm faster coding with Sublime Text or even Atom for that fact. Yes, I use the mouse and yes I want to have features and plugins that don't require me to mess about with command line.
  • tmux is great for managing different command line sessions within a single terminal emulator but I don't think it's a necessity. Lately I've been doing away with split panes and using multiple tabs.
  • Which brings me to iTerm2. As great an application as it is, there's nothing that it offers that I can't get from Apple's own terminal emulator, Terminal.

So I stopped using Vim, tmux and iTerm2 and fell back to using Terminal and Sublime Text.

I've went full circle from starting with the basics, adding more tools to the stack, before reducing the tools I need for the terminal right down to the absolute basics. One app for the terminal and one app for editing source code.

I can see the case for using tools like tmux and Vim. Maybe you spend most of your day in a terminal as a system administrator and you're faster with Vim. Maybe you need to manage multiple servers on a daily basis so splitting panes in tmux suits your line of work. I get it. I understand why these tools exist and why you would use them.

Sometimes though scaling back is just as much a benefit.

Has Web Development Gone To Shit?

 •  Filed under Web Development

There was me thinking I was absolutely bonkers for not falling head over heels in love with the current trend towards towards JS web frameworks.

The web (specifically the Javascript/Node community) has created some of the most complicated, convoluted, over engineered tools ever conceived.

The Sad State of Web Development by Drew Hamlett

I do like Drew's advice for web applications that have one or two pages with a complex user-interface.

So my advice is to use Rails Django, Play Framework, or Phoenix to develop most of the app, because they help you with most of the boilerplate stuff, and bring in the flavor of the month on a page that needs it. So when the next flavor of the month comes out you’re entire app is not knee deep in the last flavor of the month. You can just re write that one page.

The Sad State of Web Development by Drew Hamlett

How to Run Cheaters with Pow

 •  Filed under Daily Post, Web Development

Brett Terpstra released a new version of his Cheaters cheat sheet system. Brett recommends two options to get this running. The first is using the Automator application in OSX and the second is using the Fluid app.

The one change I wanted to make was to make Cheaters run as a local Rack web application with Pow rather than from the already installed Apache instance. It's easy to do.

1. Create a Gemfile

Create a Gemfile within the root of the Cheaters source and include the Rack gem:

gem 'rack'

Jump back to the command line and run the bundle command to install this gem.

2. Create the Rack App

Next create the Rack file that will serve all the pages and assets from the Cheaters source. I've used this same code for lots of Rack applications.

require 'rack'

$stdout.sync = true

use Rack::Static,
  :urls => ["/css", "/js", "/images", "/cheatsheets"],
  :root => "."

run lambda { |env|
[
  200,
  {
    'Content-Type'  => 'text/html',
    'Cache-Control' => 'public, max-age=86400'
  },
  File.open('index.html', File::RDONLY)
]}

Put this in the root of the Cheaters source.

3. Symlink Cheaters

Now I'm assuming that you have Pow installed already. With Pow installed, change to the pow directory and symlink your Cheaters directory:

cd ~/.pow && ln -s /path/to/cheaters

I also use an app called Anvil that gives me access to my running web applications in Pow from the menubar. This can also create the symlink for you if the terminal is too scary.

Done!

That's it. Now if you visit http://cheaters.dev, you'll find the Cheaters page. The reason I prefer this is that I already have a number of application running locally that I like to use, so running it from the browser is fine with me.