Action Steps for Doubling Morning Productivity

Here’s my system for engineering an incredibly productive distraction-free work block from when you wake up to 12:30pm. Although I don’t follow this routine all of the time, when I do I’ve hugely increased my ability to cut through the urgent and ensure that most important tasks for the day get completed.

Download Focus App. Setup a weekly schedule to block all distractions from 4:30am to 12:30pm on all weekdays. If you want to impress your friends, block all distractions everyday. In addition to the stock list of websites, here are some applications I block: Mail. If you use the gmail web interface, download MailPlane so you can easily block it. If you need to send an email during your distraction-free time block, just open up the browser. Messages. I hate text messages even more than email. There are no open standards, which means there is no tooling (or innovation!) around separating context and managing distraction. I’ve resorted to blocking the entire app and scheduling a recurring task (via ToDoist) to batch respond to messages. This doesn’t work completely: I still need to respond to some people in real-time. Still not happy with this piece of the puzzle: I would love an app that whitelisted specific contacts as important and provided a distraction free interface to respond. Twitter. The exception: Slack. I keep Slack open although it could be a huge distraction. Too much business-critical communication happens here. Most routers allow you to setup internet access schedules for specific devices on your network. I’ve blocked wifi on my phone from 8pm-12:30pm. This adds a little bit of friction to using my phone. Put your phone on the other side of the room, or in a place where you can’t touch it. This adds additional friction to checking your messages/notifications, even when your phone is on “Do Not Disturb” mode. Setup parental controls on your iPhone: block all social networks or distracting news sites. Setup a “Do Not Disturb” schedule on your phone from 8pm-12:30pm. Here’s a quick solution to the “I need to be available in case someone really needs to get ahold of me!” problem. Create a group in the Apple address book with a list of people who you need to be responsive to (for family, personal, or business reasons). Then, whitelist this group in your “Do Not Disturb” settings. However, the above trick only whitelists calls, not texts. I’ve slowly been communicating that phone and slack are the best channels to grab me. If it’s not important enough to call, or if you are not in a Slack group that I monitor, then it can’t be urgent enough to break my morning concentration time. Setup RescueTime to track your time usage. This gives me weekly metrics to guide me to areas of improvement. Move the mail app on your phone to the last screen. This makes checking email on your phone a deliberate choice instead of a impulsive action. Disable all notifications on your phone. Anything that you don’t need to know about right then should be sent to email where it can be handled in batches. Here are some notifications which I’ve disabled: Facebook Messenger, Twitter, email, LinkedIn, DropBox. iMessage and Calendar are the only notifications which I allow on my phone.

Let me know what you think: I’d love to hear any critique or tips you’ve found to be effective.

Continue Reading

Depositing Transaction Records in NetSuite

Moving transactions in NetSuite from “Not Deposited” to “Deposited” is not straightforward when using NetSuite SuiteTalk.

You need to ensure that undocumented requirements for each record type are met. After you’ve validated that your records are properly configured, you can include them in a new deposit using the following structure:

ns_deposit = NetSuite::Records::Deposit.new ns_deposit.payment_list << { deposit: true, # internalId of a CashSale, CustomerPayment, CustomerRefund, CustomerDeposit, etc id: 123, # the amount is not required if the currency of the payment is the same as the currency # of the bank account that the deposit is posting to payment_amount: 100.0 } ns_deposit.add

Note that you don’t need doc, type, or any of the other fields available on the a DepositPayment item. It’s also important to note that the other fields on the DepositPayment don’t actually effect how NetSuite handles the referenced transaction record. deposit, id, and payment_amount are the only fields that matter when referencing a NetSuite transaction on a deposit.

Continue Reading

Using Browser Sync with Rails and Local SSL

I’ve always been a fan of LiveReload since I first saw it years ago. However, the rack-livereload gem hasn’t been updated in a long while, and the livereload parent project seems to have died out too. rack-liveload doesn’t support reloading on local HTTPS connections, which was a requirement on a recent project—I needed a new tool.

BrowserSync came to the rescue.

In most cases, using BrowserSync’s proxy mode to reverse proxy a rails app running via a *.dev pow domain works well. For this particular project, there were a couple of specific issues:

Many pages on the project force HTTPS. A common pattern is to disable HTTPS in development: I prefer to keep the development and production delta as small as possible, and keep any HTTPS redirects enabled in production active in development as well. The site used oauth for local user authentication. Each oauth redirect URL needs to be specified in each oauth provider’s admin. This is a pain to manage, and becomes more a pain when a reverse proxy with a unique domain is used sometimes. The SSL certs served by tunnelss were not valid for the BrowserSync server causing browsers to throw invalid certificate errors.

After a bit of digging, I found a way to use my existing *.dev setup with BrowserSync. Here’s how:

Setup Apache + Pow + Tunnelss

Read through this blog post to setup your development environment to serve SSL.

Point Browser Sync to Tunnelss-generated SSL Certificates

BrowserSync has a bunch of configuration options. Some are inaccessible via the command line interface and need to be specified in a javascript file passed to the command line app.

Here’s how to configure BrowserSync to use the tunnelss-generated SSL certs to serve the secure web sockets it uses for syncing:

// https://www.browsersync.io/docs/options module.exports = { // "logLevel": "debug", "files": [ '**/*.css*', '**/*.html*', '**/*_controller.rb', '**/*.md' ], "https": { "key": process.env['HOME'] + "/.tunnelss/key.pem", "cert": process.env['HOME'] + "/.tunnelss/server.crt" } };

Throw this configuration file in bs-config.js in the root level of your project and start the BrowserSync server with:

browser-sync start --config bs-config.js Connect Your Rails (or Sintra) App to BrowserSync

To connect your application to the BrowserSync server, throw this simple javascript tag in your layout:

<% if Rails.env.development? %> <script type='text/javascript' id="__bs_script__">//<![CDATA[ document.write("<script async src='https://HOST:3000/browser-sync/browser-sync-client.js'></script>".replace("HOST", location.hostname)); //]]></script> <% end %>

Note that the above snippet does not define a browser sync version in the javascript. This makes this code a bit more resilient to browser sync updates.

I prefer this simple JS snippet to a middleware (like rack-livereload) that inserts the JS snippet into your site automatically. Keeping this code in your layout makes it easy to upgrade the code in the future, and is more declarative to new developers working on the project.

Continue Reading

Using HTTPS Locally: Pow, SSL, Rails, and Apache

Using HTTPS local development or testing environments is a hassle. A common practice is to disable SSL in development, but I’ve had too many cases of minor bugs creeping in when routing works differently between environments. I also don’t like manually having to let my browsers know that a self-signed certificate is valid.

Here’s the configuration that I use to easily add https support on my development machine to any application served—or proxied—through port 80.

Pow

I use Pow as my development rails server. However, because I often work with other languages as well, I run Apache (you could just as easily use nginx) and reverse proxy Rails application requests to Pow.

To do this, you’ll need Pow to bind to a port that is not port 80. Here’s how to configure Pow to use port 88.

Apache

I use nginx in production environments, but I’ve been using Apache on my local development machines for years and just haven’t gotten around to changing my dotfiles to use nginx. You could just as easily use nginx here.

In any case, here’s what I was looking to achieve in my apache config:

Throw error logs in ~/Sites/logs Support vhosts + xip.io domains Access WordPress sites using site-name.wp.dev Access Rails applications using site-name.dev. These requests need to reverse proxy to pow on port 88. Support proxying *.test domains to a customized port. Having a *.test domain allows you to run SSL-enabled integration tests for a multi-domain Rails application against the rspec-run rails server. Checkout my series on rails testing for more details on why this is important.

I was able to get all of this working with a single file thrown in /etc/apache2/other.

Rails: Tunnelss to the Rescue

Tunnelss is a little gem that brings it all together. It looks at your pow config, generates self-signed certificates for those domains, and adds that certificate to your keychain so your browsers accept the self-signed certificate. Brilliant.

The only downside here is you must keep tunnelss running in the background. Right now, the project doesn’t have a launchd plist available. So, for now, you have to start the application manually on each system restart.

Continue Reading

How to Refund a Customer Deposit using NetSuite SuiteTalk

When refunding a NetSuite CustomerRefund or CashSale you’ll add it to apply_list:

refund.apply_list = { apply: [ { doc: 123, # internalId of the CustomerRefund apply: true } ] }

Refunding a CustomerDeposit works a bit differently. If you inspect the SuiteTalk XML response for a CustomerRefund created for a CustomerDeposit it will appear under the apply_list XML tag. If you use that XML tag when creating the CustomerRefund you’ll get the following error:

Unable to find a matching line for sublist apply with key

Instead, you need to use the deposit_list tag:

refund.deposit_list = { customer_refund_deposit: [ { doc: 123, # internalId of CustomerDeposit apply: true } ] }

Continue Reading

7 Categories to Help Guide Your 2016 Goals

Results follow clarity, and clarity comes from clear definition. Writing is the best way to clearly define your thoughts (one of the reasons you should start a blog!).

Here are my goal categories, in order of long-term priority. Explicitly defining these categories has helped me during my goal planning process to identify which categories needs the most attention this upcoming year, and ensure that my goals align against these categories:

Spiritual Marriage Health Intellectual Financial Work Relationships

This ordering doesn’t mean that work won’t come before my intellectual life (i.e. reading, conferences, learning, etc). It does mean, for me, over the long-term I need to ensure that my intellectual life is made a priority over work success.

Although simple, the exercise of defining and prioritizing the different categories of your life, is incredible important.

Continue Reading

2015 Goals Retrospective

I’ve been making intentional yearly goals using Michael Hyatt’s Best Year Ever program for the last couple years. The simple workbook that Michael provides is effective in reviewing the past year, and defining goals for the upcoming year.

A “retrospective” is a process common in Agile Software Development, but I’ve started applying it my personal life planning lately. I made a lot of progress on key goals this past year, but still made a lot of mistakes; below is a retrospective on my 2015 goals.

Here’s what worked:

Getting clear on my goals, and the reasons (or motivation) behind those goals. Adjusting my actions and strategies to align against my goals.

Here’s what didn’t work:

I didn’t track my progress against my goals in a consistent and disciplined way. Although my goals were trackable (a key element of a successful goal!) I didn’t track against the metrics embedded in the goal. I didn’t adjust my actions and strategy, even though it was clear that my original strategy wasn’t bringing me towards my goals fast enough–and in some cases–was just the plain wrong strategy. I didn’t have a process in place to remove goals that weren’t right anymore. A goal that makes sense at the beginning of the year may not make sense mid-way through the year, and that’s ok.

My plan is to fix what went wrong with two simple tweaks:

I’m setting up a monthly recurring task in my task management application (todoist) to review progress on goals in a simple google spreadsheet. I’ve blocked off a day each quarter for a “quarterly checkin” to ensure that 1) all my goals are still the right goal and 2) the strategy and actions aligned against each goals are correct.

I’m thrilled to jump into 2016 with all I’ve got. I’m excited about these changes to my goal planning process; I’ll report back next year to see if it worked!

Continue Reading

What a Freezing Cold Pond Taught Me

A couple weeks ago, I was on a hike in a state park with some old friends. Part of the hike included a small pond with a great dock. All of us walked out on the dock, and continued talking while enjoying the view. It was mid-November and was a really cold day.

One of the guys stripped down and jumped into the pond.

A couple minutes later a couple of the guys followed.

After getting out of the pond and shivering for the next couple minutes, they all felt great; invigorated by the experience.

It’s easy to get comfortable, and resist making a hard decision or a large change. This experience reminded me that it’s possible to do something incredibly uncomfortable or challenging and come out of it just fine, and in most cases much better.

The fears that often keep me from making a hard decision or doing something risky can be easily eliminated by remembering how resilient, creative, and innovative one can be when under pressure.

Continue Reading

Determine Deposited Status of CustomerRefunds in NetSuite

Most payment and refund records in NetSuite have a straightforward way to determine if they’ve been deposited or not. The CustomerRefund is one exception: there is no way to determine from the GUI, or from the SuiteTalk API response for a CustomerRefund, if a given CustomRefund has been linked to a deposit record.

However, you can search for CustomerRefunds which are deposited or undeposited using a couple poorly documented search filters:

NetSuite::Records::CustomerRefund.search( criteria: { basic: [ { field: 'type', operator: 'anyOf', value: [ '_customerRefund' ] }, { field: 'applyingLinkType', operator: 'noneOf', value: [ '_depositRefundCheck' ] }, { field: 'mainLine', value: true }, { field: 'account', operator: 'anyOf', # undep funds account reference value: [ NetSuite::Records::RecordRef.new(internal_id: 6) ] } ] }, preferences: { page_size: 250 } )

Continue Reading

Are You Being Deliberate About Long-term Goals?

Recently, I met with a mentor about some of my past and future goals. After listening and understanding my goals, he started to dive into the motivation behind my goals.

Why did I want to build that product? Why was I interested in that type of business? What did I want my life outside of work to look like? What type of people do I enjoy working with? Am I working with those people? What type of work did I enjoy? What type of work am I excellent at? What type of lifestyle do I want to live?

I had good answers to the first round of questions, but as he kept digging I realized my answers were becoming more and more thin, and I had a lot of thinking to do.

I’m a planner by nature. I’m a checklist-driven high achiever who loves to build, create, and get things done. What the questions by this trusted mentor made me realize is my thinking and planning had been very short-term and short sighted.

My goals and ideas were aimed at the next 1-3 years and not the next 5, 10, or 15 years.

He challenged me to get intentional. To be deliberate about defining what I want to achieve. To get clarity on what I want all aspects of my life to look like: professional, family, spiritual, financial, social, etc. I was challenged to define in detail what I’m excellent at, what there is a market for, and what I’m passionate about; and to develop and find opportunities at the intersections of those three things.

It’s our duty to strive towards greatness in our lives, and through my time with this mentor I realized that I was falling short. Are you being deliberate and intentional about defining and striving towards greatness in your life?

Continue Reading