About environmental variables – an introduction to environmental variables and how they work on the server.
Another reason SPA’s suck is they assume all users are using the latest greatest highest powered device. This leaves out more than half the planet and is a very arrogant approach basically saying you are not important to us because you are poor and have a crappy device and slow connection go elsewhere you peasant.
I’ll post links here as I get time. The first one is an excellent piece covering much of why SPA’s are not a good choice.
Every time I need to set Linux Environment variables and I use google to find out how, I always end up with those VALUELESS posts that tell you to use a terminal with export blah blah blah. Then when I close the terminal and try to use a variable it doesn’t exist and I am like WTF. Well those posts are how to set a temporary environmental variable.
This post covers what I always google and get the failed results for. This post is how to permanently forever set environmental variables. This is often needed for development to store sensitive api key secrets, passwords etc. You should never put any of that information in a file for your project.
The idea is to create environmental variables to hold this info on your local machine, then when you put your code into production you add the necessary environmental variables to whatever controls them for your app. You can use kubernetes secrets or Hashicorp vault or if you are using something like Gitlab or Openshift continuous integration/delivery pipeline workflow will have a way to enter these values securely.
But here is how you set your local linux environment variables permanently. There are many ways to set these variables, here is a great article covering the topic.
But none of that above is useful to use, nope not for what we want to do. I just got a cool idea, rant/WOULDN’T IT BE COOL IF YOU COULD SET ENVIRONMENTAL VARIABLES IN MORE WAYS WITH LINUX. I mean where is the fun in only having 1 maybe 2 good ways of doing something, lets add more and more and more./rant
Ok so all of that sucks, how can we truly set environmental variables for our Development environment in a way that is easy and safe? Magic that is how. Actually what you do is create a file with all of the secrets your app needs for development testing as environmental variables. I had to search hard and long to figure this out.
You create a file with any name you want with extension .sh like example-app.sh As described in the link above Linux will read all of the files in that directory and create the environmental variables. Hours of digging to figure that simple trick out FFS.
This is basically what I have in a simple text file
You simply add a new line for each variable you want to have created for your app.
Economics of serverless – a great article if you are interested in going serverless.
PHP the Right way – a website/book full of the most useful information you will find about PHP
It is important to understand what namespaces are in PHP and how to use them. Otherwise you will be lost and have many pains.
Below is a series of great videos explaining PHP namespaces little by little in easy to find and digest chunks.\
PHP namespaces 1/10: What is a namespace in PHP?
Everything about PHP namespaces – OOP in PHP | Part 10
I couldn’t remember where the hell I had seen this in the documentation so I am linking to it here. Why?
Because it absolutely isn’t where you would expect it to be like listed under Environmental variables. Hell no why list that shit there that’s all logical and shit.
It is actually under configuration all the way to the bottom under “List environment variables.” Would be so nice if that was in the Enironmental Variables page instead or a link to it or mention of it.
Mati – provides AML/KYC/Age verification
I know I’ll never remember where I saw this. One day I will need to dump or check the environmental variables for my app.
The documentation here lists how to check the environmental variables towards the bottom of the page.