Skip to main content

Adding time to read to a Drupal article

Time is essential to all of us... and if you are like me there is never enough of it!  Anyway, the amount of time to read a piece of content can persuade someone whether to read on further... or swipe it away.  When on the verge of flipping an article as the title and /or teaser text hasn't got me across the line, the time to read is a handy reference for me.  This handy feature is becoming more common across any decent article publisher.

SwiftUI String to Binding<String> error

After creating a new view with a @Binding string as follows

struct EditRival: View {

  @Environment(\.presentationMode) var presentationMode
  @EnvironmentObject var realmPerson: RealmPersons
  @Binding var uid: String

 

The previews struct had an error with the var previews

Performance testing your Drupal website

Load testing verifies the system performance under the expected peak load.  The peak load needs to set by a series of parameters that you have benchmarked targets.  For example, these parameters could include:

Validating email in Swift or SwiftUI

I'm currently working on a project that requires login, register, forget password functionality in SwiftUI.  As I'm developing the code, I came across a great resource for validating an email address with Regex:

http://emailregex.com/

Contact list showing known contacts and the contacts in my phone

Building a contact list using SwiftUI has many challenges.

One challenge is having multiple lists displayed on the one screen.  For example, known contacts using your app against contacts on the phone.  Initially, I tried the following code

Apache version

Using a Centos 6 or 7 server, how to check the current version of Apache?

httpd -v

This command will return a string that is similar to the following:

Server version: Apache/2.4.6 (CentOS)
Server built:   Nov 16 2020 16:18:20

If you want to find where the httpd binaries are located use the following:

whereis httpd

This command will return something like:

Composer PHP version part 2

As outlined in an earlier article composer php version, when installing the latest version of Drupal the Plesk version and the server version can be different.  In plesk, the version of PHP is 7.3.18, whereas, on the Centos server a check through Terminal (php -v) shows PHP 7.1.33 (cli).

When attempting to install Drupal 9 through composer, the following errors will be shown:

Realm object with NSPredicate

What to do when you want to filter a Realm object, using NSPredicate in SwiftUI or in Swift.  

Applying the filter to a simple condition in one line

let exists = realm.objects(ExampleObj.self).filter(NSPredicate(format: "uid = %ld", uid))

Creating a variable predicate that will be injected as a condition

Uploading plist data to the server using an API

I had an instance where I needed to move content from a plist to the server database.  To achieve this step, I added a few lines of code where the plist was called and added a call to the API so the data would be on the server.

The original code appeared as:

Subscribe to