27th June 2017

Just have my first mini-presentation at work. Of course I used emoji.
🙌🏻

25th June 2017

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

24th June 2017

Snapchat has just released a new feature, and it’s one that can be taken in a few different ways. It’s Snap Map, and basically it’s a way to share and view peoples locations.

To activate Snap Map, just pinch to zoom out, and you can view any of your friends that are currently sharing their location with you.

In their short video showing the new feature (Now unavailable), it seems as it’s being advertised as a way to see where your friends are, so you can go hang out with them.

But at the same time, it’s very easy to accidentally share your location with more people than you want. This becomes a much bigger problem with a service such as Snapchat, as the majority of users are very young.

Fortunately, there is a setting in Snapchat where you can limit who can view your location. I would suggest turning this feature off completely, but it’s not a problem if it’s managed properly.

So here is how to fine-tune your privacy preferences in Snapchat:

1st Method – From Settings

  1. When viewing your profile in Snapchat, press the settings icon in the top-right hand corner.
  2. Scroll down to the section labelled “WHO CAN…”.
  3. Tap on “See My Location”.
  4. You can then choose any location sharing options from here.

2nd Method – From Snap Map

  1. When viewing the map using Snap Map, press the settings icon in the top-right hand corner.
  2. You get moved straight to the location settings, where you can choose any sharing options.

Location Sharing Options

When sharing your location in Snapchat, there are three different options to choose from (of course there’s also the option to not share it at all, by never enabling the feature).

  • Ghost Mode (Location is hidden)
  • My Friends
  • Select Friends…

So you can either hide it completely, share your location with all of your friends, or just to a selected group. In some cases, “My Friends” is a completely fine option, but that only makes sense if you only add close friends. But if you like to add other people you don’t know very well, or you just want to completely sure who you’re sharing your location with, the latter “Select Friends” option is much better suited.

Extra Tips

  • When using “My Friends”, any friends added will automatically be allowed to view your profile.
  • When using “Select Friends…”, people you allow to see your location won’t be notified, they will simply be able to see you on their map.
  • Your location is only received while you are using the Snapchat app, and apparently not in the background.
  • Any location data is deleted after a few hours.
  • To clear your last locations, toggle Ghost Mode on and off. This will clear your past data, but keep your sharing settings the same.
  • The last tip – Just be careful who you’re giving your location to.
24th June 2017

This sticker just 💯 gets me.

21st June 2017

Meat Mission with @rebeccarobot 🍔

19th June 2017

🎥 👀!!!!!!!!!

13th June 2017

View from the office.