I’ve been using a text-expansion utility almost every single day for the past couple of months. If you frequently repeat yourself while you type (i.e. you type similar things over and over), you could probably make use of an application that can expand shortcut text for you.
There are lots of utilities that provide this sort of functionality. This post does not compare utilities or offer advice on which one(s) to use; there are lots of reviews of different applications and you’ll want to choose one that meets your personal needs.
What is a text-expansion utility?
A text-expansion utility expands a shortcut into a larger snippet of text (or other media; here, I’m going to focus on text).
Let’s get into an example: say I want to type this text in quotes: “Are you there?” Normally, that’s 14 characters with two modifiers (shift for the capital letter and shift for the question mark).
Instead, I type just 3:
;yt. I use a semi-colon to prefix all of my snippets, then the characters after them are something that’s easy for me to remember. In this case,
yt stands for “you there” and nicely expands to a full sentence.
Why you need text expansion in your life
These “snippets” of shortcuts that can expand into longer pieces of text are extremely useful if you type the same thing multiple times throughout your day.
Type your email address frequently? Use a snippet.
Use a common term in some text that you’re writing? Use a snippet.
Work as a programmer and have commands that you use frequently? Use a snippet!
How I use them
As a regular computer user, there are a few things I type pretty frequently:
- My email (both personal & work)
- My phone number
- My address
As a software developer, there are a couple other things that I type regularly:
- Terminal commands
- Common/boilerplate code
There are also some less common things that I type but are handy to have:
- Code for live demos
- Bug reports
I can type all of these faster with a text expansion utility. For the common commands, I spend less time typing and type more accurately. For the less common things, I don’t have to remember the full text or copy it from somewhere else; instead, I can type the shortcut.
Expanding a small amount of text into a larger amount of text is nice, but maybe I haven’t sold you on the idea completely. Well, what if I told you that you could do things like use your clipboard in your commands to make them dynamic?
Does that catch your attention?
Let’s go through another example. Say I need to run this command:
git checkout -b branch origin/branch
branch changes values every time I use it, so sometimes it’ll be
git checkout -b abc origin/abc or
git checkout -def b origin/def
This is particularly tricky because while the command is simple, it has two parts where I need to have a common thing.
Most text-expansion applications allow you to mix your snippets with other sources. For the command above, I could copy the
branch and then invoke a snippet (in my case,
;gco) to take the contents of my clipboard and use it in the expanded snippet.
This is just one example of how you can use a text-expansion utility to speed up tricky typing situations. Different applications have different advanced functionality that covers all sorts of use cases.
Why not use git aliases?
Developers that use git like to ask me why I don’t use git aliases. The answer is simple: I want one text-expansion utility for all of my snippet-expanding needs, no matter what application I’m using.
I’m four years old and don’t have a care in the world. I tear through the house on my tricycle to meet her outside. She’s set up my tee-ball in our backyard. I take my little bat and make a big swing before my lab tries to steal the ball. It soars over our little house and she couldn’t be more proud.
I’m eight years old now and we’re waiting in the UCLA medical center’s parking lot. My step-dad walks toward us after having talked to the third doctor. It’s the first time I’ve ever seen him cry. “Get her affairs in order,” they say, “she’s only got two or three more weeks.”
I’m double-digits years old now. She wakes me up as the sun is barely rising. The crisp leafs make it challenging to sneak out of the house before anyone else gets up, but we manage. We walk a couple miles in the cold for our reward: a good, albeit cheap, cup of hot cocoa. It wasn’t often that we had quiet time alone together.
It’s my eighteenth birthday. Her kidneys have failed but she’s as determined as ever to live. I’m holding her hand just after she had surgery. Tears start to roll down my face as she faintly grasps my hand. She’s not gonna leave me.
I’m twenty-three and she’s sitting proudly in the crowd. I’m thankful and proud of her too. She did it—she managed to stay long enough to see me graduate from her alma mater.
I’m twenty-six and making dinner for my step-dad and myself. I wish she was here. I wish she could enjoy one more home-cooked meal. I wish she could see us loving each other like she loved us.
When I went to the hospital yesterday, the nurse asked me a really simple question:
“What is your relation to Sharon?”
I stumbled to find an answer because I had never, in 26 years, had to define my relationship to her.
I knew what her relationship to me was. It was playing with her and her husband Isaac at their house. It was getting confused for her son when I was out with her and my mom. It was having a home, a family, when mine wasn’t there.
I finally answered the nurse and stuttered “I’m her step-brother.”
The nurse offered to answer any questions I had about the situation. I already knew that two days before, Sharon’s fifteen-year-old son Bryce found her on the bathroom floor. A stroke. She had surgery the same day but her brain swelled. No amount of skull cracking had been able to relieve the pressure.
I had a few questions for the nurse, but she couldn’t really answer what I wanted to know: what was I supposed to say now?
I broke down and cried. I stared at the pale white hospital walls. I contemplated the purpose of each IV. I watched her vitals on the monitor. I sat there frozen with the fear of saying something meaningless. This was a one way conversation without any way to read my audience.
Bryce walked in with a couple family members. He stood in the doorway and I saw how much he had matured since I had last seen him. They were gracious enough to give me a few more minutes to get my act together and talk to her.
I told Sharon that, regardless of whether or not she could hear me, everything I said felt selfish. I could encourage her to keep fighting, but that was just an attempt to keep my hope alive. I recounted the past because I knew there wasn’t a future. I thanked her for how much love she showed me.
Her blood pressure started to drop. Just as quickly as she had the stroke, my time was cut off from finishing the words I cried out. The nurse told me to get Isaac: it was imminent.
I spent the afternoon with Bryce, Isaac, and the rest of the family. Some family I hadn’t seen in years, some I met just that day. We told stories from the past but our future is together—united, perhaps more now, because of our loss.
I spend almost every Sunday at my mom’s because I know her sickness will eventually catch up with her. Spending time with her has been my insurance against the regret most people have about lost loved ones. I now realize how simplistic that thought is.
Life is ruthless with whom it decides to take out of this world. Its timing is even worse.
Apple explains that multitasking on iOS “doesn't slow down the performance of the foreground app or drain battery life too much”—and they’re right. However, it seems as if it’s entered common “knowledge” among iPad, iPhone, and iPod touch users that closing each app after use is required to keep a device operating in its prime. This isn’t true, and here’s a simplified explanation of why it isn’t true.
The App Switcher
The “app switcher,” or the view that appears when you double-click the Home button, shows a list of recently used apps. “Recently used” is a bit of a misnomer—it actually includes any app launched on the device, unless it has been removed from the list.
You can remove a device from the list by swiping up on the app’s preview. Restarting the device does not remove apps from this view.
The app switcher does not show a list of running apps.
An App’s Lifecycle
Tapping an app’s icon launches the app. Unless the app has already been launched, the app goes from not running to being launched and in the foreground. The app is free to run as it pleases, responding to your every touch and swipe.
Now, let’s imagine you hit the home button or the sleep/wake button. The app is put into the “background,” where it’s allowed to run for only five seconds (with a few exceptions listed below). Once it’s done in the background, the app is suspended and is no longer allowed to run. Suspended apps don’t use any battery life.
Apps are allowed to run in the background for very specific tasks. Below are some of the reasons why an app might run in the background.
If the app needs more time to run for a specific task, it’s allowed to ask for more time—up to ten minutes. The system only gives it ten minutes to finish; after ten minutes, the app is suspended.
If the app is playing audio, it’s allowed to stay in the background until you tell it to stop playing. For example, if you’re listening to music and put your device to sleep, the app will enter the background and continue to play music. If you stop playing music, the app will be suspended. If you start playing music again, the app will move back into the background so it can play music.
Some apps use location in the background. For navigation-like apps that require constant updates of your location, the app is moved into the background and allowed to run for as long as it’s keeping track of your location. A location services arrow will appear in the status bar while an app is tracking your location.
Otherwise, apps that just need general notification updates (e.g. you enter or exit specific regions, or your location has changed significantly) will be moved into the background when a noteworthy location change occurs. The app is not running the entire time—the system intelligently moves the app from being suspended to the background as required. The system will display an outlined location arrow in the status bar when an app is monitoring location changes.
There are a couple of other circumstances in which an app might run in the background, but the pattern is fairly clear: when an app has something to do for you, it’ll be moved into the background to run temporarily. Otherwise, the app will be suspended and won’t be running. In general, unless an app is actively doing something on your behalf, it isn’t running, and thus does not need to be manually closed.
A Perfect World
All of the above requires everything to work as planned. Of course, bugs happen, and things do not work perfectly. If your device is getting unusually warm, or your battery is draining quickly, you might want to manually close the apps you’ve used recently (especially if they use the GPS), or simply restart your device. However, this is a last resort and not something that needs to be done on a regular basis.
I gave this talk to a local meetup. It was adapted from these blog posts:
Every once in a while, I like to reflect on things that have changed in my life. Last year, I wouldn’t have expected a change in jobs and a move back to Long Beach. At the start of 2013, I would’ve been surprised to hear that I’d own a new car and live somewhere new. A year before that, the details of my previous job would’ve amazed me.
Each year seems to bring something new. This year, that new is a fresh job, fresh apartment, fresh perspective on life. I think we hold onto the past because it’s familiar; even in tough times, we become accustom to the people and feelings closest to us. Our comfort can make us stagnate though; holding onto life as it was sometimes prevents us from discovering what it could be.
For me, this is an uneasy satisfaction with the status quo. I’ve always been solaced by the idea that destiny will forever play its hand, but that attitude disregards the effort required to make a life for yourself. It’s with this fresh approach that I’m finally starting to embrace life not just for what it is, but what I can mold out of it.
It’s this change in perspective that has me most excited about life.