{"id":2755,"date":"2015-05-10T15:00:48","date_gmt":"2015-05-10T20:00:48","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=2755"},"modified":"2023-12-20T16:25:10","modified_gmt":"2023-12-20T21:25:10","slug":"things-ive-learned-this-week-may-4-may-8-2015","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2015\/05\/10\/things-ive-learned-this-week-may-4-may-8-2015\/","title":{"rendered":"Things I&#8217;ve Learned This Week (May 4 &#8211; May 8, 2015)"},"content":{"rendered":"<h2>How to convert an NSString to a Gecko nsAString<\/h2>\n<p>I actually discovered this during <a href=\"https:\/\/air.mozilla.org\/the-joy-of-coding-mconley-livehacks-on-firefox-episode-13\/\">my most recent Joy of Coding episode<\/a> &#8211; there is a static utility method to convert between native Cocoa NSStrings and Gecko nsAStrings &#8211; nsCocoaUtils::GetStringForNSString. Very handy, and works exactly as advertised.<\/p>\n<h2>An &#8220;Attach to Process by pid&#8221; Keyboard Shortcut for XCode<\/h2>\n<p>I actually have colleague Garvan Keeley to thank for this one, and technically I learned this on April 24th. It was only this week that I <em>remembered<\/em> I had learned it!<\/p>\n<p>When I&#8217;m debugging Firefox on OS X, I tend to use XCode, and I usually attach to Firefox after it has started running. I have to navigate some menus in order to bring up the dialog to attach to a process by pid, and I was getting tired of doing that over and over again.<\/p>\n<p>So, as usual, I tweeted my frustration:<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p dir=\"ltr\" lang=\"en\">Dear lazyweb &#8211; is there an XCode keyboard shortcut for &#8220;Attach to Process&#8221; &gt; &#8220;By Process Identifier (PID) or Name&#8221;? Mousing it blows.<\/p>\n<p>\u2014 Mike Conley (@mike_conley) <a href=\"https:\/\/twitter.com\/mike_conley\/status\/591624309799571456\">April 24, 2015<\/a><\/p><\/blockquote>\n<p><script src=\"\/\/platform.twitter.com\/widgets.js\" async=\"\" charset=\"utf-8\"><\/script>AND LO, THE INTERNET SPOKE BACK: <\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p><a href=\"https:\/\/twitter.com\/mike_conley\">@mike_conley<\/a> Yes. Shift-cmd-\/, type &#8216;attach&#8217;, down arrow, enter, type proc name. next time, &#8216;attach&#8217; and proc name is remembered. \u2014 Garvan Keeley (@garvankeeley) <a href=\"https:\/\/twitter.com\/garvankeeley\/status\/591631061383192576\">April 24, 2015<\/a><\/p><\/blockquote>\n<p><script src=\"\/\/platform.twitter.com\/widgets.js\" async=\"\" charset=\"utf-8\"><\/script><\/p>\n<p>It seems small, but the savings in time for something that I do so frequently quickly adds up. And it always feels good to go faster!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to convert an NSString to a Gecko nsAString I actually discovered this during my most recent Joy of Coding episode &#8211; there is a static utility method to convert between native Cocoa NSStrings and Gecko nsAStrings &#8211; nsCocoaUtils::GetStringForNSString. Very handy, and works exactly as advertised. An &#8220;Attach to Process by pid&#8221; Keyboard Shortcut for [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[874,861,110],"tags":[1172,1137,125,1018,1133,35,1173,959,1171,1170],"class_list":["post-2755","post","type-post","status-publish","format-standard","hentry","category-firefox-mozilla-2","category-mozilla-2","category-musings","tag-attach","tag-cocoa","tag-firefox","tag-gecko","tag-lldb","tag-mozilla","tag-nsstring","tag-osx","tag-pid","tag-xcode"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-Ir","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/comments?post=2755"}],"version-history":[{"count":1,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2755\/revisions"}],"predecessor-version":[{"id":2756,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2755\/revisions\/2756"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=2755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=2755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=2755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}