<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1221636118799282415</id><updated>2011-12-29T11:37:10.732-07:00</updated><category term='iPhone advice'/><title type='text'>iOS QED</title><subtitle type='html'>iOS Quite Easily Done</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thekitchentowel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1221636118799282415/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thekitchentowel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paul Warren</name><uri>http://www.blogger.com/profile/13035643886961960348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1221636118799282415.post-4343728408793643344</id><published>2009-02-18T19:45:00.013-07:00</published><updated>2009-02-19T17:30:44.472-07:00</updated><title type='text'>Xcode user scripts to duplicate lines</title><content type='html'>Ok..so yes, you can duplicate lines in several ways in Xcode; Copy/Paste, option-Drag..but it is something I do so often (just the way I work) that I wanted a keyboard shortcut. Not only that but I wanted a second version that could also Comment out the lines just copied.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That might need a bit of explanation. Have you ever wanted to change a snippet of code but keep the original version around just in case things don't work out quite right. Me too, do it all the time, what can I say I'm a messy coder. But to do that is several steps, I've got it down to 5.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Highlight line or section&lt;/div&gt;&lt;div&gt;Command-C&lt;/div&gt;&lt;div&gt;Command-/&lt;/div&gt;&lt;div&gt;Cursor down&lt;/div&gt;&lt;div&gt;Command-V&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;but with the right user macro I can do it in 2.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Highlight line or section&lt;/div&gt;&lt;div&gt;Shift-Comand-V    (&lt;span class="Apple-style-span" style="font-style: italic;"&gt;or whatever you choose&lt;/span&gt;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After watching &lt;a href="http://www.pragprog.com/screencasts/v-mcxcode/becoming-productive-in-xcode"&gt;Mike Clarks excellent Screencasts on Xcode foo&lt;/a&gt; I was inspired to give it a try. Not being a scripting wiz I asked Mike if he would be kind enough to help and a few choice lines of Ruby later, it was all done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the two scripts. Just paste this into a new (or duplicated) user script, give a shortcut and voila. (If this makes no sense watch Mikes screencast)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;line&gt;&lt;pre&gt;#!/usr/bin/env ruby -w&lt;br /&gt;# Duplicates and comments out the original selected lines.&lt;br /&gt;lines = STDIN.read&lt;br /&gt;lines.each do |line|&lt;br /&gt;print "// #{line}"&lt;br /&gt;end&lt;br /&gt;lines.each do |line|&lt;br /&gt;print line&lt;br /&gt;end&lt;/pre&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:-webkit-monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:-webkit-monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&gt;#!/usr/bin/env ruby -w&lt;br /&gt;# Duplicates selected lines.&lt;br /&gt;lines = STDIN.read&lt;br /&gt;lines.each do |line|&lt;br /&gt;print line&lt;br /&gt;end&lt;br /&gt;lines.each do |line|&lt;br /&gt;print line&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All done.&lt;/div&gt;&lt;/line&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1221636118799282415-4343728408793643344?l=thekitchentowel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thekitchentowel.blogspot.com/feeds/4343728408793643344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thekitchentowel.blogspot.com/2009/02/xcode-user-scripts-to-duplicate-lines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1221636118799282415/posts/default/4343728408793643344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1221636118799282415/posts/default/4343728408793643344'/><link rel='alternate' type='text/html' href='http://thekitchentowel.blogspot.com/2009/02/xcode-user-scripts-to-duplicate-lines.html' title='Xcode user scripts to duplicate lines'/><author><name>Paul Warren</name><uri>http://www.blogger.com/profile/13035643886961960348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1221636118799282415.post-7784049769298467504</id><published>2009-02-18T17:40:00.000-07:00</published><updated>2009-02-18T19:36:29.837-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone advice'/><title type='text'>The Kitchen Towel?</title><content type='html'>Ok..so first off I have to answer the question that will already have popped into your mind with the light thud of a concrete block. What's with the blog name?&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ok..this is it...the big TIP..my favorite tip..the tip I tell everyone....yer..alright...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The BEST way to clean your iPhone screen is.....with a damp &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Kitchen Towel&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Really, truly and thoroughly tested, on two iPhones.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1) Wash hands in kitchen (i've kids I do this a lot).&lt;/div&gt;&lt;div&gt;2) Dry hands on &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Kitchen Towel&lt;/span&gt;&lt;/div&gt;&lt;div&gt;3) Use, now slightly damp, &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Kitchen Towel&lt;/span&gt; to wipe down your iPhone screen....nice and clean.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The point is, your iPhone screen is remarkably robust and can pretty much be wiped with anything dry or damp...my T-Shirt is my second best option (but a bit dry for greasy finger marks)...and so far I've NEVER seen a scratch. Of course your milage may vary. Wipe at your own risk !&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1221636118799282415-7784049769298467504?l=thekitchentowel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thekitchentowel.blogspot.com/feeds/7784049769298467504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thekitchentowel.blogspot.com/2009/02/kitchen-towel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1221636118799282415/posts/default/7784049769298467504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1221636118799282415/posts/default/7784049769298467504'/><link rel='alternate' type='text/html' href='http://thekitchentowel.blogspot.com/2009/02/kitchen-towel.html' title='The Kitchen Towel?'/><author><name>Paul Warren</name><uri>http://www.blogger.com/profile/13035643886961960348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
