Skip to content

Instantly share code, notes, and snippets.

@fzwo
fzwo / LegacyDocsets.md
Last active May 15, 2024 10:16
Download and view old Apple developer documentation

How to download and view legacy documentation from Apple (no need to sign in to your dev account)

  1. Download the docset index XML.
  2. Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
  3. Download the dmg. It's probably around a gigabyte or so.
  4. "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
    1. Find the largest file, named Payload, and extract it using The Unarchiver.
    2. This creates a new, even larger file, probably named Payload-1.
    3. Extract Payload-1 using The Unarchiver.
  5. After many minutes of extracting, we have our .docset file.
@huacnlee
huacnlee / .tm_properties
Created November 1, 2013 02:20
~/.tm_properties TextMate 2 for Ruby, Ruby on Rails, RSpec 配置文件
[ "{*.yml,*.yml.default}" ]
fileType = source.yaml
[ "{Capfile,Gemfile,Gemfile.lock,Guardfile}" ]
fileType = source.ruby
[ *_spec.rb ]
fileType = source.ruby.rspec
[ "{app/{models,controllers,mailers,helpers,cells,uploaders}/**/*.rb,*_controller.rb,*_helper.rb,*_mailer.rb}" ]
@leovandriel
leovandriel / gist:3794804
Created September 27, 2012 15:59
NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel
// NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel.
// Similar to the `sendAsynchronousRequest:` method of NSURLConnection, but
// with `cancel` method. Requires ARC on iOS 6 or Mac OS X 10.8.
// License: BSD
// Author: Leonard van Driel, 2012
@interface NWURLConnection : NSObject<NSURLConnectionDelegate>
@property (nonatomic, strong) NSURLRequest *request;
@property (nonatomic, strong) NSOperationQueue *queue;
@eaigner
eaigner / NSURLConnection+Timeout.m
Created April 20, 2012 15:19
Synchronous NSURLConnection timeout
@implementation NSURLConnection (Timeout)
+ (dispatch_queue_t)timeoutLockQueue {
static dispatch_queue_t queue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL);
});
return queue;
}
anonymous
anonymous / snippet.rb
Created October 26, 2010 16:05
require 'rubygems/user_interaction'
module Gem::RubyGemPlus
RUBYGEMPLUS_CACHE = File.join((File.writable?(Gem.dir) ? Gem.dir : Gem.user_dir), 'cache')
RUBYGEMPLUS_USER_AGENT ="rubygem"
class GemPlusRemoteFetcher < Gem::RemoteFetcher
def download(spec, source_uri, install_dir = Gem.dir)
return super unless scheme_supported?(source_uri)
CurlUnsafeDownloadStrategy.new(source_uri + "gems/#{spec.file_name}", spec.file_name).fetch
@woodie
woodie / README.rdoc
Created January 3, 2010 23:32
Rails 2.3.5 on App Engine with DataMapper

Rails 2.3.5 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment