Put Yourself In Nature

In what is likely to be one of the most hippy things to make its way to my blog…the title of this post is supposed to be an almost universal piece of advice to virtually all situations.

From just one ride out in the New Forest recently.

It seems to be something that’s becoming more and more forgotten. It’s something that I struggle to understand how people can live without. Throughout the existence of our species, it’s continuously been nature that has fascinated us. Nature has inspired us, provoked us, questioned and in many cases provided answers for things.

The course we’re taking as a species seems to be allowing people to withdraw more and more from engaging with nature. Preferring to view it through a screen, than interact with it up close, before inevitably being distracted by technology fighting for our attention. I’m fortunate, I have access to some wonderful environments not too far from home. A spectacular coastline and a beautiful forest. It’s hard to say how not having this would affect me, but I feel confident that not being able to place myself in nature would have a substantial negative impact on all aspects of my life. Everything would suffer, from work to communication and the full spectrum of relationships in my day to day life. If I go too long without it (a week), I can feel myself getting stressed and restless.

I feel sympathy for those who don’t seek what nature has to offer.

The Science Backs It Up

I haven’t donned some tie-dye robes and braided my hair, luckily the science backs it all up. The numbers on anxiety, mental health, stress, and concentration disorders are alarming. The gulf  in psychological well-being between those who seek out time in nature and those who don’t seem to confirm what the chaps in white coats keep telling us.

For brevity sake, I’ll just grab the headlines, but all are backed with scientific studies.

  • Improved concentration.
  • Improved levels of serotonin.
  • Reduced stress and blood pressure.
  • Improved sleep.
  • Improved productivity.
  • Significantly more creative.
  • Reduction in anxiety.

In all honesty, I hope you’re no longer reading this, and have decided to go outside instead.

All the photos in this post are mine. A small sample taken in about a 6 month period.

Connecting CakePHP 3 To A Database

This quick guide will continue from this setup tutorial, and show you the simple edit you need to make to your CakePHP ‘config.php’ file to connect to you’re database.

This of course will work with any mysql setup, but since we setup our installation on a Digital Ocean Ubuntu server using the PHPMyAdmin one click setup I’ll point out where you can find your mysql user and password info while we’re here.

When you login to you’re server via terminal:

You should be given a welcome message and some info about your setup. You should be able to see something along the lines of the following:

  • The URL to access PHPMyAdmin will be: http://YOUR_IP/phpmyadmin
  • Your user will be: admin
  • Your password will be: Whatever is displayed above

Also not the last line in the above image. There is a ‘.digitalocean_password’ file created in the ‘/root’ directory of your server. If you open that file in a text editor you’ll see that your mysql installation has a few users already configured, one of which will be the same as the user above.

Step 1: Create a Database

First you need you’ll need to login to PHPMyAdmin and create a database for your CakePHP application to use. Once you’ve logged in create a new database by clicking ‘New‘ on the top of the menu on the left of your screen (below):


Give your database a name (lowercase, no spaces…obviously), hit ‘Create’, and you’re done here.

Step 2: Update the Config File

You need to connect your CakePHP config file to your new database. The easiest way to do this is to login to your server with FTP software (Filezilla for example).

Once you’re connected navigate to the directory path: /var/www/html/YOUR_APP_NAME/config

In this directory you’ll find an ‘app.php’. This file contains a lot of the general setting for your application, it’s extremely well commented. For now you need to tell it what database to use and the user and password for said database. At the time of writing this in the latest version of CakePHP they are lines 232, 233 and 234. Update the placeholder info with the relevant data and save the file. Upload the new version of that file overwriting the old one, and were done. If you return to the default home page of your application (your IP address if you’ve followed from this setup tutorial), you should now see that your application can talk to your new database.

Time to start making stuff!


Installing Firebase with CocoaPods

Installing Firebase with CocoaPods is much like installing any other pod.

First you’ll need a Podfile. If you’re integrating Firebase into a project that already uses libraries from CocoaPods, obviously you can use the existing file.

Fire up a new terminal window and navigate to the folder where your project is located. Mine is on my desktop in a folder called ‘FirebaseDemo’, so my terminal command will look like this:

Next you can create a new Podfile:

Open that file in a text editor of choice (do not use TextEdit) and you should see something like this

The few instances of ‘FirebaseDemo’ will obviously be replaced with the name of your Xcode project. Lines starting with a hashtag are commented out. I’ll remove them for clarity, you can do the same of leave them as they are.

Replace the line ‘# Pods for FirebaseDemo’  with the following:

As you can see the Firebase library is broken into parts. It’s a substantial library, and you may not need all of it, this gives you flexibility to only include the parts that you want. Including the Core, Database, and Auth component is probably a fairly common setup to get started.

Finally, back in terminal (making sure your still in the correct folder)  run:

CocoaPods will go and install the relevant dependancies you’ll see something like the following:

The important part of this, as with all projects using Cocoapods is that you need to open the .xcworkspace (the white icon) file in Xcode from now on.

Using Firebase in your project requires that you setup a project in the Firebase console and “link” it with an app. For a guide on that process can be found here.