Skip to main content

Registering users via REST

Registering a user via REST is an important process particularly when the requests come from a mobile device.

In working through the process you might have come across error message like:

403 Forbidden : "Only anonymous users can register a user."

422 Unprocessable Entity : "A Password cannot be specified. It will be generated on login."

So how did I get these and what to do?

Applying a patch via Terminal

As a process I apply patches locally first, then using git upload the update(s) to a development site on the server.  Once the testing has been completed, the final step to apply the patch to the production site.  

Using Terminal or your preferred shell program, navigate to the correct directory.  Then run this command using the name of the patch file (example.patch):

CDN error on pod update

Today while in Terminal, I ran a regular script pod update.  However, this time I received the following error

[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/d/a/2/Alamofire/5.1.0/Alamofire.podspec.json Response: Timeout was reached

I read on GitHub that it could be a cache issue, so I ran:

Creating a new SwiftUI project

Creating a new SwiftUI project is a quick process.  There are already thousands of sites outlining how to do these steps.  Rather than repeat this steps at the top of each article, we will refer to this article to get you across the line if you don't know or need a refresher.

Step 1

Open Xcode and either click Create a new Xcode project in Xcode’s startup window, or choose File > New > Project.

SwiftUI adding a background image with a gradient tint

I'm going to take you on a journey about adding a gradient tint to a background image.  The journey will go through text modifiers with regular and semibold font weights, and font colour.  Using an image from Unsplash.  Adding a black tint, then transform it to a gradient using a colour array.  If you get lost along the journey, the final result is available on GitHub.

Centos server restart

I'm receiving a server not found when logging in to Plesk from shell or Terminal.  Specifically the error message I'm receiving is

Can't connect to the server

My first reference for this fix is to run the command 

sudo service httpd restart

Running this command you will see the following in Terminal

Gradient tint over a background image

How to apply a gradient tint over a background image?

Set the background image

The first step is to set the background image.  I wanted the image to cover the entire device, so scale aspect fill will be required.

self.backgroundImage = UIImageView(image: UIImage(named: "bgkMain"))
self.backgroundImage.contentMode = .scaleAspectFill
self.view.insertSubview(self.backgroundImage, at: 0)

 

Copy directory

To copy the content of a directory /source to another existing directory /destination can be achieved with the command cp -a

cp -a source/. destination/

Changing the variables accordingly:

  • source = challenge/vendor/
  • destination = stg/vendor/

cp -a challenge/vendor/. stg/vendor/

Subscribe to