<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for lukeredpath</title><link>http://disqus.com/by/lukeredpath/</link><description></description><atom:link href="http://disqus.com/lukeredpath/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 04 Nov 2014 08:05:13 -0000</lastBuildDate><item><title>Re: 依赖注入，iOS和你</title><link>https://www.bignerdranch.com/blog/dependency-injection-ios/#comment-1675654843</link><description>&lt;p&gt;Good post, but I think it would be good to demonstrate how you could go one step further with this.&lt;/p&gt;&lt;p&gt;Despite the convenience initialiser, you have now made the dependencies of this class explicit and as somebody says below, you've now made it necessary for anything else that creates this to require knowledge of how to wire it up.&lt;/p&gt;&lt;p&gt;You could of course use a factory but one thing that remains unchanged is that this particular implementation is explicitly coupled to NSURLSession and NSNotificationCenter. Explicit is better than implicit of course but there's still a coupling.&lt;/p&gt;&lt;p&gt;To me, the next step would be to decouple instantiation of this class from the places it's used by creating it in one place and passing it to the classes that need it. Additionally, you could extract the fetch methods into a protocol and only depend on that. This makes it fairly trivial to write a new implementation of the protocol that, for instance, uses AFNetworking or NSURLConnection. You only need to swap out the implementation in one place. You could also create a fake implementation that fetches canned data without having to mess around stubbing NSURLSession or other low level framework classes (only mock types you own).&lt;/p&gt;&lt;p&gt;IMO this would arguably be a more valuable refactoring. Making dependencies explicit is often a good thing and I can see why you might want to configure this class with something other than the default session but I'm not convinced it does anything to aid unit testing (I'm not a fan of mocking framework classes and I think a class like this is better treated as an "adapter" in hexagonal architecture speak and tested using integration tests, possibly with something that records and replays network requests at a low level like VCR for performance reasons. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Tue, 04 Nov 2014 08:05:13 -0000</pubDate></item><item><title>Re: Building automatic login tokens for emails with Rails and Devise</title><link>http://derwiki.tumblr.com/post/93421187906#comment-1542338033</link><description>&lt;p&gt;Be careful with #find_by_token - it can be vulnerable to a timing attack. This is why it was deprecated in Devise.&lt;/p&gt;&lt;p&gt;The way I approach this is to create a base64 encoded token that contains a piece of static user-identifiable information - you could use their email or their user ID - and the user's auth token.&lt;/p&gt;&lt;p&gt;The server can decode this, extract the user ID and use it to find the User and then compare the auth token using a secure comparison method (Devise has a secure_compare function that will do this for you).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Thu, 14 Aug 2014 07:50:52 -0000</pubDate></item><item><title>Re: Hashes and encapsulation: Jon Leighton</title><link>http://jonathanleighton.com/articles/2012/encapsulating-hashes/#comment-415475321</link><description>&lt;p&gt;What's wrong with defining #[] on DOMElement, so attributes can be fetched thus: el["some-attribute"]. Seems reasonable to me. I'm pretty sure this is what Alex meant.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Thu, 19 Jan 2012 12:53:10 -0000</pubDate></item><item><title>Re: Automating iOS Over The Air Beta Deployment</title><link>http://www.hectorramos.com/automating-ios-over-air-beta-deployment#comment-132515452</link><description>&lt;p&gt;Hi Hector&lt;/p&gt;&lt;p&gt;You might want to check out my betabuilder gem which takes care of a lot of this (it's a Rake task library) and supports uploading to TestFlight too.&lt;/p&gt;&lt;p&gt;&lt;a href="http://github.com/lukeredpath/betabuilder" rel="nofollow noopener" target="_blank" title="http://github.com/lukeredpath/betabuilder"&gt;http://github.com/lukeredpa...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;It's available as a Ruby gem.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Fri, 21 Jan 2011 13:30:11 -0000</pubDate></item><item><title>Re: http://blog.twoguys.us/post/1487937592</title><link>http://blog.twoguys.us/post/1487937592#comment-94175191</link><description>&lt;p&gt;Trying it out now, seems to work OK - does it report symbolicated crash backtraces from app store releases?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Fri, 05 Nov 2010 10:51:40 -0000</pubDate></item><item><title>Re: Is Pusher up?</title><link>http://blog.pusher.com/2010/6/24/is-pusher-up#comment-58404276</link><description>&lt;p&gt;I guess it could be useful to add API support for this, so libraries can check Pusher's status when they have problems, it could be something as simple as &lt;a href="http://status.pusherapp.com/api" rel="nofollow noopener" target="_blank" title="http://status.pusherapp.com/api"&gt;http://status.pusherapp.com/api&lt;/a&gt; returning 0 or 1 in plain text to save having to parse the HTML. Full JSON in the future if you add more useful information (or both if you don't care why its down).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Thu, 24 Jun 2010 07:25:34 -0000</pubDate></item><item><title>Re: Bringing device sync to Squeemote  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/bringing-device-sync-to-squeemote.html#comment-6360974</link><description>&lt;p&gt;You'll find an updated version of the interface here:&lt;br&gt;&lt;a href="http://skitch.com/lukeredpath/bfnq7/devicemanager" rel="nofollow noopener" target="_blank" title="http://skitch.com/lukeredpath/bfnq7/devicemanager"&gt;http://skitch.com/lukeredpa...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Tue, 17 Feb 2009 22:02:46 -0000</pubDate></item><item><title>Re: Productivity Tip: Read Your Blogs in the Afternoon &amp;mdash; A Single Programmer's Blog</title><link>http://blog.teksol.info/2009/02/16/productivity-tip-read-your-blogs-in-the-afternoon.html#comment-6305018</link><description>&lt;p&gt;I have to say I'm generally the complete opposite; for the first few hours of a day I'm generally pretty useless, with only the occasional exception.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Mon, 16 Feb 2009 09:33:49 -0000</pubDate></item><item><title>Re: Remote pair-programming using iChat  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/remote-pair-programming-with-ichat.html#comment-6261952</link><description>&lt;p&gt;Hi Tom, I have seen SubEthaEdit but I'm a bit too attached to TextMate to give it up. Now if TextMate integrated remote collaboration, that would be awesome.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Sat, 14 Feb 2009 13:16:21 -0000</pubDate></item><item><title>Re: Remote pair-programming using iChat  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/remote-pair-programming-with-ichat.html#comment-5836171</link><description>&lt;p&gt;Naturally, its easy to lose some of the subtleties of face to face communication when using iChat (unless you're using video conferncing of course) but I the better you get on with the person you are working with, the less of a problem this becomes (e.g. you should be reasonably attuned to when a person is joking/being ironic/sarcastic etc.).&lt;/p&gt;&lt;p&gt;I haven't been doing it remotely long enough to say for sure how more or less efficient it is than pairing in the same room but so far I'm pretty pleased with our output and overall velocity.&lt;/p&gt;&lt;p&gt;Re: screen and vim, I'm sure these can be equally good tools for remote pairing if you are comfortable with them. I could probably spend time learning how to use screen and vim fluently but I'd much rather stick with tools I'm already familiar with.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Wed, 04 Feb 2009 10:36:14 -0000</pubDate></item><item><title>Re: Squeemote, the Squeezebox iPhone remote, ready for sale  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/squeemote-for-iphone-ready-for-sale.html#comment-5814792</link><description>&lt;p&gt;I assume you mean putting it into standby using the top button; this is a known bug and will be fixed in the next release.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Tue, 03 Feb 2009 14:14:52 -0000</pubDate></item><item><title>Re: Squeemote, the Squeezebox iPhone remote, ready for sale  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/squeemote-for-iphone-ready-for-sale.html#comment-5814067</link><description>&lt;p&gt;Its not something I've tested personally but I can't see any reason why it wouldn't work. The server detection will not work of course, so you'll need to enter the IP/port numbers manually and ensure these ports are open on your router. I can't vouch for the speed of it though; precaching the albums list if you have a large database might take a bit longer over the net.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Tue, 03 Feb 2009 13:45:28 -0000</pubDate></item><item><title>Re: Squeemote, the Squeezebox iPhone remote, ready for sale  | the blog of luke redpath</title><link>http://lukeredpath.co.uk/blog/squeemote-for-iphone-ready-for-sale.html#comment-5491107</link><description>&lt;p&gt;Random Mix is definitely in the works. Possibly 1.2, otherwise 1.3.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Luke Redpath</dc:creator><pubDate>Fri, 23 Jan 2009 04:30:29 -0000</pubDate></item></channel></rss>