On Morning Rituals

Rituals are important. I’m a creature of habit. But, I had never characterized some of the things I do as rituals.  I read some posts by Casey Liss and David Smith that were not unlike some of the things I do.  I like repetition. I like not having to think about a decision or even make one to begin with.  Similar things for breakfast each day. If I cook a big meal I’ll have the leftovers for subsequent meals until they are gone.

Having these rituals help me get my day going. They let me know that all is right in the world.

My morning ritual is something of a decision tree:

Gym

I used to go to my gym a lot more often; 4-6 days a week. Adding in runs on top of that if I was training for a race. Lately 3 days a week seems to be my norm. I’ve grown to be ok with this. Personal and work stress are adding up, and that’s what I can do right now. Which is funny because the gym is a huge stress relief for me. But, I digress.  If I go to the gym, I shower at the gym after my workout, then walk to work.  I either have breakfast with me or I pick it up on the way to the office. If I have it with me, it means I cooked it the night before: 3-4 eggs fried in coconut oil, seasoning, maybe some sourcraut (It’s a lot better than you think it is). If I pick it up it’s some kind of veggie omelet or scrambled eggs with a vegetable.  This has been my morning gym ritual for about 5 years now.  I started drinking coffee about a year ago. I have a half cup from the pot of work if I eat breakfast there.  I add 2 cubes of ice to it from work’s freezer.  I want to drink it immediately and this brings it to the right temperature for my taste. Having this repetition helps me start my day. I usually eat my food at the cafe table, with my laptop, doing a quick pass of email.  I’m trying to shift this into doing something with the first hour of my day, not just drowning in email.

Wakeup time: 5:35am. Catch 6:07 train into the city. My clothes are laid out the night before. Wakeup, chug protein shake so I’m not starving, wash face, brush teeth, do inhaler, run to train.

Home

If I sleep in, I eat and have coffee at home.  I’ll wakeup and jump in the shower to wake up a little. Breakfast will be 3 eggs and sometimes a few strips of bacon.  I put the frying pan on high. While it’s heating up I put the kettle on.  I crack a few eggs into the pan. While they are sitting, I start getting the Aeropress ready.  I love the Aeropress. It’s perfect for a single cup, or even 2 if I’m making one for Laura. I get my coffee from Tonx.  If you aren’t familiar with them, I highly recommend. You get your coffee every 2 weeks for a monthly fee. The beans are roasted fresh, which apparently augments the taste.  I don’t have to worry about running out, or remembering to pick some up from the store. It just shows up. Less stress.  The amount of coffee I drink is perfect for their lowest plan. At most I end up with an extra cup and a half of beans. It’s very, very rare that I run out. I also tried Drifwaway coffee which I really liked. They send you a sample pack of 4 types of coffee. You rate each one and this effects what your shipments are in the future. I consistently got something I really enjoyed. I occasionally get something I’m not a big fan of with Tonx.  You might wonder why I don’t just pick 1 thing and stick with it. That would be less stress, actually. But, I’m still getting into coffee and exploring what I like. I can’t tell you right now what type of coffee I like using the right terminology. But, Driftaway’s shipment size was too big for me, I ended up having a decent amount leftover.

Wakeup time: in between 7 and 8, depending on what my morning for work looks like

Run

I may, like I did this morning, get up 30-60 mins before my sleep in time and get a run in.  If it’s going to be raining I’ll opt for this. I love running in the rain.  The amount of running I’ve been doing recently has dropped drastically. I’m trying to get back into it. I really do love it. After the run, I fall into what I normally do at home.

I use an alarm for all of these. For the gym, I’ll set the Sony clock radio I’ve had since I was 6. I’m amazed it still works, though it took me a while to find a link to it online. I wake up at the same time for the gym, no matter the day. I just flip on the alarm. Laura keeps it tuned to NPR, so I wake up to that.  The other days I’ll use my phone. Siri sets alarms for whatever time I need.

I never snooze. Never have, don’t think I ever will.  If I’m not going to get up until 20 mins later, I’d rather just get that as real sleep time.  My alarm clock has always been in a place where I have to get up to turn it off. (This was particularly helpful in college. I woke up at 4:40 for practice. Sleep was very valuable)

If you are frazzled in the morning or feel stressed out getting ready for work, think about repetition. What would you want to do every morning? What of your routine can be ritualized? If you did a few things the night before (pick clothes) would that lessen your stress in the morning? Think about it. I love it.

If you have any rituals that help you start your day, or lower your stress, let me below in the comments or on Twitter.

The Rise and Fall of Communication Mediums

Brent Simmons:

My blog’s older than Twitter and Facebook, and it will outlive them. It has seen Flickr explode and then fade. It’s seen Google Wave and Google Reader come and go, and it’ll still be here as Google Plus fades. When Medium and Tumblr are gone, my blog will be here.

The things that will last on the internet are not owned. Plain old websites, blogs, RSS, irc, email.

Marco Arment:

This is why I’m still championing blogs, RSS, and using your own domain even though supposedly “everyone” has moved to social networks.

I’m very, very glad I started blogging 7 years ago.  I started out just wanting to help people. I’ve continued posting code both for tutorial purposes and to work through my own problems. At some times it’s been a voice for me, and I’ve dabbled in commentary.  Facebook is older than this blog, but I’m fairly close to Twitter.  I never thought we’d see the day when Google Reader would shut down. These days Google doesn’t surprise me anymore. Which, should say something. I was a HUGE Google fanboy. Since moving off blogger, I’ve managed the servers and software that run this blog. I plan on being around for a long time. It’s too much fun to stop

Podcast Reruns

Last year, I had been plowing through old episodes of a few Tech podcasts. I was able to get through all of Developing Perspective (they are short) and was working on Build and Analyze.  I’m halfway-ish through B&A, but my listening has died off in leu of new episodes of other shows.

I’ve missed listening to it.  The reason it dropped of is playlist related. Everything I listen to is in one playlist that I prune from time to time. I didn’t add B&A to it because I didn’t want to have to download each episode each time. I downloaded them all at once. If I added it to the playlist, all 108 episodes would have shown up.  I had a separate playlist just for this show. But, I would forget about it.

I got to thinking about reruns. TV has them. YouTube has them.  Why not this medium?  Whether specifically for podcasts or RSS feeds in general, I thought something might exist. Something that would take a feed and give back the items at a pubDate+days interval. This way, whatever you consume the feeds with, will think it’s new. This could be done by modifying the pubDate, though some feed scrapers might not care that a pubDate might be in the future.  The other method would be to restrict a feed based on a range of days (or weeks for Podcasts).

I googled around for a bit. The back of my mind thinks it remembers something from…. 5 or so years ago? No luck. Then I wanted to build a service to do it… Then I remembered time is scarce these days. Yahoo Pipes to the rescue!!

I got a pipe working that overcast would accept and process. Then tweaked it for more public consumption.  

http://pipes.yahoo.com/timbroder/podcastreruns

The Pipe has 3 inputs (listed in a different order from that link for ease of explanation)

  • Feed URL: Paste in the url of your podcast feed here
  • How Many Weeks ago to start: This is when in the podcast to start pulling from. If want to start at the very first episode, use the number of weeks between when the episode first aired, and now.  I want to start B&A at episode 49. It aired on 10/24/2011. It’s currently 7/29/2014. So, I want to start 145 weeks ago
  • How many episodes do you want per week: This depends on how much you want, and how often the podcast released episodes.  If it was a weekly podcast and you want to get 1 episode a week, put 1. If it was weekly and you want 4 episodes a week to catch up faster, put 4.  What this is doing is loading all the feed items in between the “start week” and this number at once. Podcasts that come out more than once a week will be multiplied by this number

Configure as needed, then cick “Run Pipe” to confirm you see the appropriate episodes. Then, grab the RSS url for this configuration. Load this URL into your pod catcher.

2014 07 29 1602

I’ve been testing this for a few weeks now and it’s working great! Another good use would be Overcast’s “Retired Greats” Section:

 Overcast1

If you are interested in the inner workings of this Pipe, here is a screenshot. Though, looking at this now, getting more than 1 episode a week needs some tweaking.

2014 07 29 1606

“make” time

We’re often told you need to “make” time, a phrase that rankles me.

Drives me nuts as well. Our days are already packed. "Making time" isn’t making it; it’s prioritizing time. If you make time for something, you are acknowledging that the thing you are making time for has a priority at the expense of something else.

That’s why it’s important to know how long something takes, or to break it down into micro projects. By doing so, you may discover that you can reclaim time “might” by being more efficient, or by delegating tasks (whether they be personal or business-related).

This is interesting. I’d be interested in trying it and seeing where all my time is during the day. (I already track all my work hours. Outside of that) I would worry about it being consuming though. Then stressing about missed logs. Maybe

Permalink

UITableViewCell Action Swiping in iOS8 and Swift

Mail.app in iOS7 brought swiping cells to the inbox. The iOS8 beta added a 3rd button to it.  Apple has also introduced an API to assist with creating this effect: UITableViewRowAction.  Prior to this, I used SWTableViewCell.

14870105002 77af4bf515 b

Below is how to get the basic functionality working. Please note that you have to implement the 2nd function whether it has a body or not

I can’t get the (-) delete indicator to appear when I put the table into edit mode though. Setting UITableViewCell.shouldIndentWhileEditing = NO is supposed to disable this effect. I’ve tried setting it in 3 places: 

I’ve had to add some workarounds to deal with this for now.  I’ve filed rdar://17969970 against this. For now, this is how I’m handling by checking if I’m already in edit mode when I build out the actions array. This isn’t ideal at all. I don’t even want to be able to delete when I’m in edit mode, just reorder. Apologies for switching back to obj-c. The delegate I’m working in is older.

This post and the Radar helped me collect my thoughts to post on Stack. I’ve been afraid of backlash or Noob. Time to get over it.

Update 2014-09-11

Vanyas has a great sample application that addresses what I’m trying to do.  I was forcing the delete button on the right hand side myself.  Updating editingStyleForRowAtIndexPath to the below fixed my issue:

|  

How to Restore a Time Machine Backup From a Synology NAS

My Sunday morning started off like this:

My laptop wouldn’t finish booting. All I got was a backlit, black, screen.  I went through numerous combinations of booting with option, cmd+R, cmd+shift+R, un-mounting, ejecting. In all methods, trying in vain to get the Disk Utility to verify and repair the hard drive. I tried from Recovery Mode and a fresh OSX install on a USB hard drive. The things I saw on my screen included:

  • The aforementioned black screen
  • A backlit, white, screen
  • A gray screen with a flashing Folder with a question mark in it
  • “Live file system repair is not supported
  • There’s an error with the EFI system partition’s file system.”
  • Clean installs were failing: “An Error occurred while preparing the installation.  Try running this application again.”
  • “Verified failure: unrecognized file system”

After a few hours I moved from “I need to fix this” to “I need to get my laptop back up.” Ok let’s do a clean install: “An Error occurred while preparing the installation.  Try running this application again.” Crap. At this point I booked a genius bar appointment for the next day just in case. 3 clean installs failed.

Took a break to think about it…. I got back into Disk Utility and formatted the partition. Then deleted/recreated the partitions. Formatted again (why not?).

At this point a clean install worked. Ok… Seems like the drive isn’t totally dead. But, I want to do a fresh restore from my Time Machine backup on my NAS. I normally also have a SuperDuper! backup. I didn’t. That’s a story for another time.

Apple doesn’t quite support NAS Time Machine; there are a few hoops you have to jump through:

  1. Get into recovery mode (Boot while holding cmd+R)
  2. Open the terminal
  3. Go to Volumes
  4. Make a place to mount the NAS
  5. Double check it’s there
  6. Mount your NAS. This is the IP of it in my house. This should be the IP you use to get to the admin console. My Admin is: http://192.168.1.205:5000
    You’ll also need to know what share your Time Machine back is in. For me, it has it’s own drive, represented by “timstimemachine”. I’ll go into the details of my NAS setup in a future post
  7. Check you see files in the synology folder
  8. Even though we’re mounted, we won’t see this backup in Time Machine Restore just yet. Use hdid (hard drive image driver) to mount the sparse bundle image
  9. If your drive or the backup was encrypted, You’ll need to enter it’s password at this time
  10. Make sure your backup is still mounted
  11. Ok, quit the Terminal and load up Time Machine Restore
  12. You should see the backup we just mounted
  13. Start the restore. It can take a while. Mine is around 360 gigs and it estimated 16 hours. It took a lot less than that but it finished when I was sleeping so I don’t have an accurate time.

Sunday was a stressful day. Hopefully this can help you.

|  

Twitter or RSS

If you had to choose between only reading Twitter or only reading weblogs, which would you choose? Losing Twitter would be a bummer for a lot people, but losing weblogs would decimate the web. We should do more to strengthen weblogs and RSS because they are the foundation for so much of the most important writing on the web.

#RSS4LIFE

Joking aside, I do get a lot of my news from twitter these days. I would say half the articles that I’d be interested in reading (dumping to Instapaper from Reeder or Mr. reader) I’ve already added from twitter.
Luckily, I use Feed Wrangler so I don’t see duplicates of something already in Instapaper when browsing my feeds.

Permalink

Dismiss a Modal UIViewController created in Interface Builder

There are a number of posts on this subject on Stack. They involve re-instantiating (this seems slower to me) or yanking the view from a UIButton (this feels dirty).

I’d rather just update the UIBarButtonItem that I already have:

 

2014-07-27_1826

All I needed to do, was attach the appropriate target and action to the UIBarButtonItem:

Using PonyDebugger on a device

PonyDebugger is awesome. I use it mostly for Core Data debugging. Most of the time, I find it easier then firing up SQLite Professional

When using the simulator, hitting localhost:9000 is fine. On a device, not so much; you need to hit your machine. xip.ioto the rescue! What it is: xip.io is a magic domain name that provides wildcard DNS for any IP address. We use this heavily at work if the machine we’re on isn’t hooked up to a subdomain or Vagrant Share.

We can use this wildcard to have our iPhone hit our laptop’s instance of PonyDebugger.

First, get your IP. I use this Alfred workflow. Take note of your local IP.

Start PonyDebugger listening on that IP:

For handy access, alias this command: 

Load Pony in your browser by appending your IP to the a xip.io URL: http://192.168.1.10.xip.io:9000/

To access via the simulator or a device:

UITapGestureRecognizer in Swift

I have a subclass of UIView that has a label:

I want to attach a Tap Gesture to it:

|