Image for post
Image for post

A few days ago (November 13, 2019) GitHub announced the general availability of GitHub Actions. CI/CD solution from GitHub. I tested it with two of my projects and I have to say I’m impressed. But first thing first.

I will describe below how I configured two of my projects (Angular 8 and .NET Core 3) with GitHub Actions.

Continuous Integration

After each commit we would like to have a feedback about build result, linter and unit/e2e tests etc. For that reason we have to create yml files in folder: .github/workflows (for example: .github/workflows/build.yml) with steps definition.

Angular 8

For angular application our file should look like on below snippet. …


Image for post
Image for post

In my previous articles (part 1, part 2) I described how Apple built dynamic wallpapers in macOS 10.14. In the latest macOS beta (beta 5) Apple introduced some small improvements in that area. First of all you can notice changes in desktop settings screen.

Image for post
Image for post

Now when we chose dynamic wallpaper we can choose how system will display it. We have three options: dynamic (wallpaper will change during whole day), light (system will display only one, light picture) and dark (system will display only one, dark picture).

For that purpose Apple changed also plist metadata in HEIC file in dynamic wallpaper. …


Image for post
Image for post

In my previous article I described how dynamic wallpapers works. I didn’t know then what some of the properties in metadata means. I asked if somebody else knows what that properties means, and I’ve got a response really quickly. On Twitter @zwaldowski wrote to me explanation what all properties stands for.

Image for post
Image for post

Thus, as I wrote previously, in HEIC file we have metadata which looks like on below snippet.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>si</key>
<array>
<dict>
<key>a</key>
<real>-0.34275283875350282</real>
<key>i</key>
<integer>0</integer>
<key>o</key>
<integer>1</integer>
<key>z</key>
<real>270.9334057827345</real>
</dict>
... </array>
</dict>

We have 16 dict elements (one for each image) with four…


Image for post
Image for post

How Apple built dynamic wallpapers? And is it possible to create your own dynamic wallpaper for macOS? I spent some time because I would like to answer to the both above questions.

In Mojave we can choose new type of wallpaper: dynamic.

Image for post
Image for post

Depending on day time, system displays different wallpaper. At night it is picture of Mojave at night, during day it’s picture of Mojave taken during day. So at night we have dark wallpaper at day we have light wallpaper.

All built in wallpapers in macOS we can find in folder: /Library/Desktop Pictures. …


Image for post
Image for post

Which Swift framework for handling JSON encoding/decoding is the fastest? Is there any faster then built in algorithms which operates on Codable protocol? And how we compare them to the .NET Core implementations?

As you may know I’m trying to figure out how can I build, in most efficient way, server side application in Swift. I chose Perfect framework for my application and I have already built some example project. I wanted to know how I can compare performance between that solution and very similar written in .NET Core. I expected that application created in programming language which is compiling to native code will be faster than interpreted by .NET runtime. I described my experiment here. However I decided not to give up and try to find framework for JSON which will be fast enough and comparable to .NET …


Image for post
Image for post

Click here to share this article on LinkedIn »

Before you choose language/platform for your server side application you should know if it fulfills your requirements. For that kind of application performance it’s especially important. I spent a few last weeks for building server side Swift application (example project which I described in my previous articles). But is it fast enough? And how fast is Perfect/Swift compared to more mature platforms like .NET? Can we choose Swift as a solution for server application which requires extraordinary performance?

There are benchmarks which compares server side Swift frameworks and Node.js. …


Image for post
Image for post

REST API is very popular and common way to expose APIs to software applications. However, besides undeniable advantages it also has disadvantages. One of them is lack of common interface for retrieving information about API endpoints (list of endpoints, request/response object’s metadata, possible status codes, authorization etc.).

Of course nature abhors a vacuum and developers create frameworks and specifications which are very helpful here. Most common solution was created by OpenAPI Initiative. Here you can find detailed description of OpenAPI specification. We also have great tools which can present API in readable for humans format:


Image for post
Image for post

Click here to share this article on LinkedIn »

What is continuous integration? On Wikipedia we can read:

In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day.[1] Grady Booch first named and proposed CI in his 1991 method,[2] although he did not advocate integrating several times a day. Extreme programming (XP) adopted the concept of CI and did advocate integrating more than once per day — perhaps as many as tens of times per day.[3]

Thus basically CI from our source code can build target application (executable) frequently (in best case after each commit). This can be done by several ways like simple scripts or by software created specially for that purpose. We should be notified about status of build process (especially when build fails) — and this is one of most important purposes of CI. …


Image for post
Image for post

My previous articles described how I realized MVC pattern in server side Swift HTTP application. Previous articles from that serie:

  1. Server side Swift — MVC
  2. Server side Swift — MVC (unit tests)
  3. Server side Swift — Configuration files
  4. Server side Swift — Object-relational mapping (ORM)
  5. Server side Swift — Services, Repositories & Data validation
  6. Server side Swift — Authentication & authorization
  7. Server side Swift — Resource based authorization

Now we will create Docker file, push it to the Docker hub and create Web App for Containers on Azure.

Create Dockerfile

First we have to install Docker for your system. When we have Docker ready we have to create simple configuration file: Dockerfile. This file is like a recipe — we have to get some base image, install new application and add a pinch of this and that.


Image for post
Image for post

My previous articles described how I realized MVC pattern in server side Swift HTTP application. Previous articles from that serie:

  1. Server side Swift — MVC
  2. Server side Swift — MVC (unit tests)
  3. Server side Swift — Configuration files
  4. Server side Swift — Object-relational mapping (ORM)
  5. Server side Swift — Services, Repositories & Data validation
  6. Server side Swift — Authentication & authorization

Now we will add resource based authorization (authorization to specific resource/object) to our API.

Authorization described in current article is very similar to resource based authorization implemented by Microsoft in ASP.NET Core. Here you can read more about it:

In my implementation I will also have similar…

About

Marcin Czachurski

#iOS/#dotNET developer, #Apple  fanboy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store