Skip to main content

Code conventions

Whatever you are coding - code clarity is your goal.

Adding a ssl certificate to ejabbered on apache

Adding a pem file to secure ejabbered on the server for chat connection.

Getting the pem file

I downloaded the pem file through Plesk (v17.8.11) under the SSL/TLS Certificates area.  Locate the certificate that you want to use and click the green arrow which when hovering will day download all certificate components.

ejabberd log

To access the ejabberd log files, I found them located at the following directory

cd /usr/local/var/log/ejabberd

The following files exist:

  • crash.log
  • ejabberd.log
  • error.log

 

Installing Erlang XMPP on Apache

I'm writing these steps primarily for myself as a reference.  However, if someone else finds them useful to great.

Adding XMPP framework to your server.  Initially I was going to add Prosody, however as I'm working off an Apache server with Centos 6.10 this quickly proved to a goal that was out of reach.  Instead, I pivoted and redirected to Erlang.  

Creating a .pem file for push notifications

To create a .pem file, is quick once you have your .p12 certificate.  I won't go through the process regarding p12 file generation as there are many sites that outline these steps.  If you cannot find a site that outlines this make a comment below and I'll point in the right direction.

Open the terminal and go to the path where you save the apns-cert.p12. where and follow the below command to generate the .PEM file.

Filtering an array list

I had the issue where I needed to filter an array list by a specific column.  In my instance, the column is language.  To be able to reduce the query to the language column the code required is

levels = selectedCategory?.levels.filter("language = %@", language)

Language can be any string, in this instance for me language is a two alpha character such as 'fr', 'en' or 'de'.

Further to this you can continue to chain this query through including sort as per

How to programmatically change the app language without restarting the app

iOS localization on the fly

If you have added languages to your app... shortly afterwards you'll be getting yourself knee deep in changing the language on the fly.  Followed by the question – how do you change the language of the app without having to restart the app?  To change the language of the app there are a couple of key steps involved:

Font list for the iOS

A handy resource list of fonts for iOS:

iOS Font List - https://iosfontlist.com/#availability=10.0&preinstalled

LearnUI - https://learnui.design/blog/ios-font-size-guidelines.html

Resources for your app or site

Images

For some time, when looking for images online for your app or site I have been going to Unsplash.  As I come across more image sites that are noteworthy they will be added to this list.

Unsplash (https://unsplash.com) – is an amazing resource for beautiful, high-resolution and free photos

Subscribe to