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.
We’ve had many interns from BSU in the web development department at PBC, and two things that we emphasize with them is source control management (SCM) and test-driven development (TDD). So for my curriculum, I wanted to add at least SCM.
I briefly touched on SCM in one of the first classes, going over how to use Git get code pushed to GitHub for assignments. My students were struggling with getting their code pushed to their repositories so today I let my students have the class to ask questions.
Originally I’d demoed using Atom for writing code then using SourceTree for pushing to their repositories like we do at work. One of my students was using GitHub Desktop (kind of by accident). I’d forgotten about that tool and it seemed to make more sense to use since Atom, GitHub, and GitHub Desktop dovetail nicely together.
I have used GitHub Desktop for a few projects before but I tend to use SourceTree or just command line:
$ git add --all; git commit -m "add all the things"; git push;
I am trying to get back into the habit of doing a bit drawing every night. Here’s a few of newer ones. I’d like to get one a day done again, collecting a bunch to make a coloring book like I made a few years ago.
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”.
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
Well, tonight I kinda freaked out our 8 year old son Miles. We has just sat down for his ritual of one episode of The Big Bang Theory before bed. Katie was looking though news feeds and mentioned that Trump had taken the Florida primary and that Marco Rubio was likely to suspend his campaign (then he did shortly there after).
“Well, I guess we’re moving to Canada” I said. Miles turns around with tears in his eyes. “Are we really moving? I won’t get to see my best friend [omitted] anymore?!”.
After a little while he was calmed down and went back to watching Sheldon swimming in a ball pool with Leonard chasing him. Bazinga!
Bazinga. That’s all I can say about the current political theater. I don’t think we’re going to leave the country over it though.
I found out a cool usage for composer that I didn’t know about; use it for installing WordPress plugins. I use Phing to do all my deployments (slowly moving towards continuous integration with Jenkins). I wanted a way to get the plugin files and include them with my deployment automagicly. Composer can download and extracting the plugin archive file rather than using the gui in the wordpress admin. This task can be done when all your other required libraries are installed.
I wanted to install Contact Form 7. In order for this to work you need to download the plugin from a custom repository, so I setup my composer.json file something like this:
I set the name of the repo to the “takayukister/contact-form-7″ and then used that as it’s require name with the current version (right now 4.3.1). The paths in the “extra” section tell composer where to put the plugin once it’s installed.
In my Phing build.xml I could then run this before any packaging tasks: