Table of Contents
- Backup your database
- Check my code out of Github, or create a module directory
- Create a project info YAML file
- Create the necessary subdirectories
- Write the code to display your block
- Clear the caches
- Enable the module
- Place the block module
- See the custom block on your website
- The biggest problem I encountered
- The source code
In this tutorial I’ll demonstrate how to write a simple Drupal 8 “block module.” By this I mean that I’ll show you how to write a simple Drupal 8 module that will display output in a block. When you’re done you will have created a new block that you can place in one or more theme regions.
Quite often when I’m asked to review a UML “Use Case” that someone else has written, I ask “Have you tested your Use Case with real data?” Sadly, the answer is usually “no.”
I don’t know why people don’t do this, but they don’t, and it seems like a very logical thing — essentially a unit test for Use Cases.
Printing columns of information from Unix text files is easy, especially using commands like awk, perl, and more recently, ruby. This short tutorial shows my old-school
awk way of doing this.
awk column printing examples
Suppose you have a file named foo with contents like this:
1 2 3 a b c
You can easily use
awk to print columns of information from this file. Here are a few examples that show how to print the data columns from the file:
I started an “autoimmune” diet a few weeks ago, and one thing it has done is to make my problems more consistent. This is one of my current problems: at rest my blood pressure is usually low and my heart rate is often in the 95-110 beats per minute range.
Here’s a link to five more chapters from my book, Functional Programming, Simplified.
Today’s work: Review at least four more lessons of my new book, Functional Programming, Simplified.
When I was younger I didn’t really like The Beatles, though I did like individual songs by John Lennon and Paul McCartney. Lately I’ve been listening to a lot of McCartney and The Beatles, and this quote from the Wikipedia’s A Day in the Life discussion is good:
“Paul and I were definitely working together, especially on ‘A Day in the Life’ that was a real ... The way we wrote a lot of the time: you’d write the good bit, the part that was easy, ‘I read the news today’ or whatever it was, then when you got stuck or whenever it got hard, instead of carrying on, you just drop it; then we would meet each other, and I would sing half, and he would be inspired to write the next bit and vice versa. He was a bit shy about it because I think he thought it’s already a good song. Sometimes we wouldn’t let each other interfere with a song either, because you tend to be a bit lax with someone else’s stuff, you experiment a bit. So we were doing it in his room with the piano. He said ‘Should we do this?’; ‘Yeah, let’s do that.’”
(Here’s a link to A Day in the Life on YouTube.)
There was a time when I had the misconception that yoga is about exercising the body.
Then one day my wise teacher (who studied directly under Iyengar) told me, “If you aren’t paying attention to your actions, all you’re doing is stretching.”
Android 7 comes with a cool new “split screen” feature where you can look at two apps running at the same time. This little pictorial/tutorial shows how to use this split-screen feature.Back to top
How to use the split-screen feature
Step 1: Open two or more apps
The easiest way to get started with this feature is to have two or more apps open. You may want to open more than two apps, because some apps won’t support the split-screen feature. For instance, at the time of this writing, Kindle and Netflix don’t support it. I recommend starting a browser like Chrome, and another app like Twitter or an email app.
Tip: When you’re first getting started, open a few Google apps. They are more likely to work in split-screen mode than other apps.
Step 2: Tap the “recent apps” icon
What started off as an accidental finding resulted in me performing a test on myself the last few weeks. The results are in, and I think they’re pretty conclusive: right before going to bed, if I turn off the tv (or put down the book I’m reading) and meditate for a little while, I remember my dreams more, sleep less, and wake up more refreshed.