Sunday, June 12, 2016

iOS push notifications with sound from Amazon SNS

When sending push notifications from Amazon SNS, to iOS endpoints, with the default JSON format, they are received without sound.
The default format would look like this:
{
  "default" : "Message"
}

In order to get sound for push notifications on iOS, the JSON payload should look like this:
{
  "default" : "Message",
  { "APNS":"{\"aps\":{\"alert\":{\"loc-key\":\"%@\", \"loc-args\":[\"Message\"]}, \"sound\":\"default\"} }" }
}

Why does the payload look like this? I have no idea. The point is that it works at the moment this article was written. I've found it somewhere on stackoverflow, but I can't find it again, so I'm just posting it here for whomever needs this information.

Saturday, January 23, 2016

Creating thumbnails for remote videos

You have some video files stored on some remote storage (dropbox, google drive) and you want to create thumbnails without downloading the whole file.



Tuesday, January 12, 2016

Configuring ssh keys for git access on Ubuntu

To be able to connect to a git repository with ssh access (ssh://) use the following steps:
  • copy your private key file to ~/.ssh
  • create (if it doesn't exist) the file ~/.ssh/config and add the following content:
Host my_githost.com
    HostName my_githost.com
    User my_username
    IdentityFile ~/.ssh/my_private_key_file
  • change the permissions to the private key file:
chmod 400 ~/.ssh/my_private_key_file
Now you can clone your repository.

Monday, January 11, 2016

Migrating a svn repository to git

I realize there are a ton of articles about migrating from svn to git, but this is mostly a note so I don't forget the steps. My situation is a bit particular since I need to import an svn folder to git.



Sunday, December 27, 2015

An opinion on TDD

TDD (Test Driven Development) seems to be used a lot in technical and management circles, together with "CI", "scrum" and other agile-ish buzzwords. Since I've got an internet connection and the ability to throw my opinion into the wild, I think I'll do just that.



Saturday, December 26, 2015

Reusing std::thread objects

Sometimes it's useful to reuse a std::thread object - from a resource and design point of view. This would seem trivial, but since the std::thread was designed as a single use object, there are a few tricks to reusing it.



Sunday, December 13, 2015

Running a stand alone child process from a parent process

Sometimes it is necessary to start a process from within another process, whether it is for executing a command line utility or to create a peer process with which the parent process will need to communicate.