PowerShell: Search, Replace Text in Files

January 26, 2010 by dpurrington
#get a pipeline of files
gci -r -i '<filename pattern>' |
 #filter for the search pattern, don't want to needlessly update files
 #if there isn't a match
 ?{Select-String -Path $_ -Pattern '<match regex pattern>' -quiet} |
    %{
        #get replacement content
        $text = [io.file]::ReadAllText($_) -replace '<regex>', '<replacement>'
        #write back out to disk, ascii encoded if desired
        $text | out-file -enc ascii $_
    }

This post was inspired by this discussion.

Looks like I’m going to have to change the margins on the blog to show code snippets better.

Vistaprint to Launch Custom Embroidery

January 25, 2010 by dpurrington

This is very exciting news. Vistaprint (my employer) announced today the acquisition of Soft Sight, Inc., and plans to launch custom embroidery in the first half of 2011.

Some info on Soft Sight:

Soft Sight has developed a sophisticated software capability for automatically rendering stitch patterns from custom designs uploaded to its website. Soft Sight’s innovative and patented automation systems enable an end-user’s embroidery artwork to be uploaded and embroidery designs to be instantly previewed and modified online. This drives its ability to provide high-quality custom embroidered products in low quantities at low prices.

Very cool! Can’t wait to see this.

Browser Tip – Make Text Bigger

January 22, 2010 by dpurrington

If you find yourself squinting and want to make the text in your browser bigger or smaller, just hold down the control button and scroll your mouse wheel. One way makes it bigger, the other smaller. You can also use <ctrl> and the plus and minus keys to the same effect.

This works in both Internet Explorer and Firefox.

Open Thread – Name this Blog

January 21, 2010 by dpurrington

Trying to come up with some ideas for a better blog name. I want to keep the URL the same, but put a title on the blog that is a little better. Ideally, it won’t have “blog” in the title. The purpose is to be mostly technical (programming, technology, and the like), some random entertainment, and certainly no politics.

Yesterday, I saw a great blog title, “Dennis the Peasant”, a reference to Monty Python and the Holy Grail. “Dennis, there’s some lovely filth down here!”

So anyway, blog name. Suggestions?

Get Productive…

January 20, 2010 by dpurrington

…at the Ultimate Productivity Blog.

You’re welcome!

Scott Hanselman: Tips on Managing Your Life

November 26, 2009 by dpurrington

Scott gave the (a?) keynote at Oredev recently, and his talk was entitled “Information Overload and Managing the Flow.” It is heavily influenced by David Allen’s Getting Things Done. Considering the level at which he participates in social networks (Twitter, Blogging, etc), it’s interesting to hear him discuss how too much data coming in can really screw you up and cause you to “thrash to disc.”

What follows is some of the advice he offers to improve your effectiveness and efficiency.

Email Advice

  1. Don’t check email in the morning
  2. If you respond, they will respond
  3. “If you are the fastest responder to a problem, you will get all the problems. Don’t put energy into things you don’t want more of”
  4. Use blogging instead of email.
  5. Don’t use email for writing a book. 5 paragraphs is too long.
  6. Have a separate inbox for mail you’re cc’d on. It’s less important. Likely not urgent or an action item.
  7. GTD folders:
    1. @Action
    2. @Blog
    3. @Podcast
    4. @Read
    5. @Reply
    6. @Waiting/Follow Up

(At one point, he says, “Now I can Google . . . with Bing . . .” LOL.)

Focus Techniques

  • Use personal Scrum sprints
  • Use the Pomodoro Technique: using an egg timer, do only one thing for 25 minutes. Keep track of your own internal interruptions, which allows you to introspect, to be aware of what you’re doing.
  • Limit yourself to a single “news” (as in NEWS) feed. If 9-11 happens again, you’ll hear about it.
  • Use aggregators: engadget, boingboing, lifehacker. [Ed: and Reflective Perspective]

Finding the Leaks

  1. RescueTime will automatically track your behavior (websites mostly) and give you graphs of all the time you’ve wasted. Cool.

Organization Tools

Summary

  • Audit & sort your sources
  • Schedule work sprints
  • Turn off distractions
  • How are you triaging your inbox?
  • Consider you personal toolbox

Nice job, Scott. Thanks for the tips.