Wow, it’s been a while! Yesterday I got the opportunity to participate in Hour of Code, a global program that tries to get kids learning what code is and how it’s used every day.
I talked yesterday with Mrs. Hansens’ 2nd-grade class at Lincoln Elementry, Bemidji for about 20 minutes, giving examples of what code is and how it’s all around us. Afterward, I helped students work through logic problems in their computer lab using Scratch. I was amazed at how quick the students just “got it” when working through the problems.
Hour of Code a great program and hopefully they’ll ask me to participate next time.
I’m getting in the habit of using a .env file for loading environment variables. Laravel already uses them for setting up configuration. It’s a nice way to setup variables that can be used in bash or through a php library like vlucas/phpdotenv.
For a site I’m working on I wanted the environment variable APP_ENV set to “local” in development and set to “production” on the live site (each environment has it’s own .env file). My configuration keep on getting overridden somewhere and returning “dev”.
What happened was the APP_ENV environment variable was already set in the Apache virtual host configuration and phpdotenv will not override variable set in Apache virtual host configuration.
If you are running into this same issue a pretty easy fix. Unset the variable in you .htaccess file and then the correct value will load from your .env file. At the top of my .htaccess file in the public root I have this then:
# unset the APP_ENV variable since it might have been set in Apache's vhost file and needs to be used from .env
Hope that helps!
This is the first in a series of “today I learned” posts. Today it’s all about the pseudo element
::after. This isn’t new news to most I’m sure, but I’ve just recently started using these and think they are pretty cool.
Say you are working on a site where you have access to the styles but not the DOM. You need to add an element to the page without actually adding any markup to a page. That’s where
::after come in. You can add either of these
.element::after to add extra element to the DOM this way.
I created an example (albeit kinda crude) to show how to use the elements. The snowman’s torso is a DOM element and the head and foot are added via
.snowman::after css elements. Same with the hands, there’s a empty
.hand element on the page and the left and right hands are placed with
See the Pen MKVwLg by Nate Nolting (@natenolting) on CodePen.0
One caveat I’ve found is if you want the added
::after to behave like a block element you must add
content: ""; to your css in order for the element to display, otherwise it has no height or width.
It does seem that we can all use it, so go a make some pseudo elements!