Programming


ON: BY: Chris Hannah

Jannis Hermanns took on a rather interesting challenge recently, and it was all about working from an iPad Pro.

But unlike most people that make the switch, he’s not a writer, manager, or a designer. Jannis is a backend engineer, that uses some terminal in some hardcore ways!

In the summer of 2017, I wanted to know what it would be like to use an iPad Pro as my main computer. I found out that it can actually work, thanks to an iOS app called Blink, an SSH replacement called Mosh, iOS 11 and running stuff on a server.

His perspective/experience I find, is different than most other macOS to iOS switching articles, as there was a lot more technical issues that had to be solved.

But nonetheless, he managed it in the end.

Sadly for myself though, this switch isn’t something that I could do myself any time soon, as I develop 99% of the time using Xcode. Sure, I could probably run that on a Mac, and use a iPad to operate it. But what’s the point in that.

Read the full post.

ON: BY: Chris Hannah

As I’ve been getting back into development for Hydrate (a water intake tracker for iOS), I’ve been thinking about the sort of representation of myself as a developer.

When I think of a great developer, they usually have a small number of apps. Sometimes they’re all at a really high standard, but most independent developers I see, have one or two main apps, and a few more fun ones.

I have been developing for iOS/macOS for quite a few years, and I have to say most of them are dead, stale, or heading in that direction. So it’s time for a clear out. This might not be a very interesting article, but I certainly think the act of me writing this, will aid in the process.

For some background information, here is the list of apps that I’ve made for iOS/macOS, and their current status.

Name Platform Status Description
Hydrate iOS/watchOS Available. My current work-in-progress, a water intake tracker.
Pretty Regular Expressions iOS/macOS Available. Regular expression tool for macOS/iOS. Very simple.
Pixels Sticker Pack iOS Available. Some pixel art iMessage stickers!
AniMatchers iPhone Available. Just a fun memory matching game, with cartoon animals.
Bill Splitter iOS/watchOS Available. A super basic bill splitter. Mainly a small project so I could check out the watch SDK.
Qwiki macOS Available. My wikipedia menu bar app, which is one of my best projects in my opinion, which I will hopefully update soon.
Tap Gap iOS Available. A quick game for iOS, where you try and tap the screen when a line is between a certain gap.
Floppy Turd iOS Available. An awful, but funny remake of Flappy Birds. It took a sunday morning to create, and that was where I left it.
TinyMe iOS/macOS Removed. One of my first few apps, they used the goo.gl api to shorten longer links, but they aren't an issue anymore.
Postie macOS Available. I used to blog on Scriptogram, and this was a basic Markdown editor with publishing built in. The service has unfortunately shut down.
The Girlfriend Helper iOS Removed. I think the first app I made. It was an app that suggested message you could send to your girlfriend depending on the event type.
Halloween FX iOS Removed. Basic soundboard app, which also featured a timer so you could hide your phone and scare someone.
The Farm iOS Removed. Even more basic soundboard app, just contained farm animals.
Bug Splatter iOS Removed. This was a weird one, there's multiple levels of bugs/difficulty, and the aim was to splat as many of them before they reached the end of the screen.
Whack iOS Removed. A pretty simple whack-a-mole game, but with pixel art, and funny noises.
TextShot macOS Never made it. This was a really fun project to work on, it was going to be an app where you could select a bunch of text, and it would generate a picture from it, even including multiple different styles. Sadly the MacBook I was using at the time died completely, and I wasn't clever enough to think about source control back then.

Okay, I didn’t actually know I already removed a few of these already. But there’s still some clearing out to do.

My aim is to have a small number of applications, that either are stable, and need hardly any maintenance, or ones that I can regularly keep updated, and are proven to be worthwhile.

So if you just take the apps I have available, there’s 9. Well one isn’t released yet, but it’s in progress.

  • Hydrate
  • Pretty Regular Expressions
  • Pixels Sticker Pack
  • AniMatchers
  • Bill Splitter
  • Qwiki
  • Tap Gap
  • Floppy Turd
  • Postie

If I separate them into the groups I mentioned before, I’m left with this:

Maintainable Apps:

  • Hydrate
  • Qwiki
  • Pretty Regular Expressions?

Minimal Effort/Stable Apps:

  • Pixels Sticker Pack
  • Tap Gap

Left over:

  • AniMatchers
  • Bill Splitter
  • Floppy Turd
  • Postie

That was pretty quick and easy, and it sort of represents what I already had in my head. Out of the four left over, they all have very good reasons why I don’t want to support them anymore. Low download numbers, super old code, and lack of interest to work on them again.

So, they’re be removed.

That leaves just five remaining apps, three I feel that are maintainable, and the other two are kind of eternal to an extent.

Of course Hydrate will stay, I mean I haven’t even released it, and it’s still in active development. Qwiki is stable, and my most popular app, so that will also stay.

Pretty Regular Expressions however was initially well taken, but I haven’t had any desire really to go back to it, and improve it. I will have a look at the code again, and hopefully I can add something to make the app even better soon.

Pixels Sticker Pack is a bunch of images, and I can’t see myself ever needing to update these. They’re fun, and I still enjoy using them!

That leaves Tap Gap, it’s a simple game, that still works fine. I’ll certainly make a few changes and support the iPhone X soon, but that is only a minor issue.

So the remaining apps, along with their pricing are:

Name Price
Hydrate Not decided.
Qwiki £2.99
Pretty Regular Expressions (iOS/macOS) £0.99
Tap Gap Free
Pixels Sticker Pack Free

Not a bad bunch!

I’ll be checking out a few of these projects today, and maybe even get thinking about the changes/updates I can make!

If you want to follow on with more detail, just follow me on twitter!

ON: BY: Chris Hannah

If you’re a programmer, you’re probably aware about version control and Git, and maybe even what a .gitignore file is.

If you don’t:

A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below for details.

Anyway, creating these files can be annoying to write manually, and there a bunch of templates all over the internet to make this much easier.

I however, found a much better solution for creating these files, and it’s gitignore.io. It’s a website that you can use to generate a .gitignore file, but also a command line tool that you can use, so you never have to leave your terminal.

It has support for operating systems, IDEs, and programming languages. So my standard file will be generated from macOS, Xcode, and Swift, since that’s how I roll.

You can type (with autofill of course) whatever templates you want to make use of straight into the website, and then hit ‘Create’.

Screen-Shot-2017-09-06-at-15.57.00

For the command line, you’ll have to first install it, and then the gi command will be available. All you need to do is type gi followed by a comma-separated list of the same items you would use on the website.

So mine would be:

gi macos,xcode,swift.

The command would of course, output this out via the standard output, so you can direct it straight into your .gitignore file by writing something like:

gi macos,xcode,swift >> .gitignore

It’s super easy, and it saves a lot of time.

As a little bonus, there’s also a quick video on how to install and use the command line tool.

ON: BY: Christopher Hannah

I made my first API today, and I used Swift to do it!

Basically, I got bored this afternoon and decided to have a little research into server-side Swift programming. I’ve heard about this before, but I’ve not gone too deep into it myself.

The problem with me tying things like this, is that I ever really have a good idea, or scenario which I could use to learn the new thing. Well as you may already know, I’m slowly working on a title casing application for iOS and macOS, and therefore I’ve already created a few functions to format text.

So far the base TextCase functions are:

  • Uppercase
  • Lowercase
  • Title Case
  • URL Encoding
  • Mocking SpongeBob (yes, like the meme)

From these formats, the only ones I could see being useful are Title casing, and the fun SpongeBob format.

From making use of various APIs myself, I knew that all I needed was a super simple HTTP server, which had support for a few GET requests.

Perfect was the tool I used to write the server side code, and I found a quick tutorial which explained the basic HTTP server that I needed. I must say it was really easy for me to create this, as I’m already familiar with Swift, so the only thing to learn was the “Perfect” way of doing things.

Because it was in Swift, I could also reuse my main TextCase class which handles the formatting. There was a slight exception, where the arc4random_uniform function isn’t available on Linux, but I found a Linux suitable replacement for this.

There are also a few more reasons why I wanted to try this out, but they’re rather meta. For example, I’m a big fan of Swift, and it feels good working with “low-level” Swift if you can really call it that, and also because I just love the look of Swift in the default Xcode theme, with the SF Mono font 😍 (weird, I know, but it’s the truth).

The final code (as in what I’ve done so far), is three endpoints, which are actually just two. /title/{input text} is to return the given text in title casing, /spongebob/{input text} is for the SpongeBob case. The third one is just /{input text}, and it returns the text in every format available, which is just the two I mentioned so far. The results are in plain JSON, and also include the plain value that was sent in the request.

For example, here is an example response to the / endpoint:

{
    "plain" : "what the hell is this",
    "title" : "What the Hell Is This",
    "spongebob" : "wHAT ThE Hell iS thiS"
}

Anyway, you can view the project over at GitHub, and if you want to suggest any new formats (or even write some yourself), just let me know on Twitter at @chrishannah

ON: BY: Christopher Hannah

It’s been a while since I actually wrote something, and that’s mainly because of my university work that’s been piling up (I finish this June!), and also because I’ve been developing a few mini projects with Swift. The latter is what I’m going to be writing about today.

Basically, over the past few weeks I’ve been getting back into using the command line more. Why is a hard question, but mainly because I’m a nerd, and it’s pretty fun!

It started when I kept seeing a trend of more of the people I follow on Twitter, either retweet or post GIFs of command line apps. It also led me to Hyper, which is a terminal application, and it’s actually built using JavaScript, HTML, and CSS. You can also customise it a ton, especially with the massive amount of themes available.

I personally, have Hyper set up with the hyper-ayu theme, and my favourite monospaced font, SF Mono.

This is getting a bit too meta, so I’ll bring it back on topic.

So I’ve actually developed four command line applications in the past two weeks, and they’ve all been build using Xcode/Swift[1]. The apps themselves are unix executable files, that can just be double-clicked and ran, but on each project I include more helpful installation/usage information.

cwiki

(Not to be mistaken with my macOS app, Qwiki)

This is the first one I made, and it was probably the easiest of them all. That’s because the majority of the code I could just reuse from my already released app, Qwiki! This app, cwiki , is just a super minimal version of that app.

You just type cwiki followed by a search query, and it will print out the most relevant matches. It does however, only print out a basic description of the articles.

Check out cwiki on GitHub.

So after the first project, I was a bit more intrigued, I decided to make a more interactive app. slink is purely a URL shortener that uses the Goo.gl API, but this lets you shorten, and also expand (Goo.gl) shortened links.

The slightly more complex functionality than before, led me to work out how options are managed in command line apps. So if you want to shorten or expand a link, just use either -s, --shorten, -e, or --expand. I also made a mini usage guide, that you can print out using -h or --help 🤓.

Check out slink on GitHub.

hacker

The third project was a bit similar to the first two, in that it made use of a few different options to return different data, but it also presented it like cwiki.

It’s a basic interface for Hacker News, and by making use of the various options, you can retrieve the new, top, and best lists.

Check out hacker on GitHub.

TitleCase

Okay this one is really simple, it makes use of Brett Terpstra’s TitleCase API, which formats a given string of text to the AP Title Case style. I actually find these types of tools perfect when writing a blog post, as usually the title is formatted incorrectly.

The API was probably the easiest one I’ve ever used. But then again, there was only one parameter, no options, and one return type.

Check out TitleCase on GitHub.


Now I guess everyone knows what I’ve been up to, so I can get back to slaving away over university work, and making some random projects!

P.S. I actually have some other really great news that I’m going to share here soon, but I’m just waiting on it being finalised a bit more.


  1. My favourite programming language 😍. ↩︎