Given a set of documents, each associated with multiple tags, how can I retrieve the documents tagged with an arbitrary set of tags?
My solution
| //Customise Backbone.sync to work with Titanium rather than jQuery | |
| Backbone.sync = (function() { | |
| var methodMap = { | |
| 'create': 'POST', | |
| 'read' : 'GET', | |
| 'update': 'PUT', | |
| 'delete': 'DELETE' | |
| }; | |
| var xhr = Ti.Network.createHTTPClient({ timeout: 5000 }); |
| #!/usr/bin/env ruby | |
| # | |
| # A quick script to dump an overview of all the open issues in all my github projects | |
| # | |
| require 'octokit' | |
| require 'awesome_print' | |
| require 'rainbow' |
| module CouchDBAttachments | |
| def attachment(*args) | |
| lambda do |env| | |
| request = ActionDispatch::Request.new(env) | |
| doc = DocWithAttachments.get(request.params[:doc]) | |
| serve_attachment(doc, request.params[:path]) | |
| end | |
| end | |
| private |
| #!/usr/bin/env ruby | |
| # | |
| # Put this script in your PATH and download from onemanga.com like this: | |
| # onemanga_downloader.rb Bleach [chapter number] | |
| # | |
| # You will find the downloaded chapters under $HOME/Documents/OneManga/Bleach | |
| # | |
| # If you run this script without arguments, it will check your local manga downloads | |
| # and check if there are any new chapters | |
| # |
| Thread.current[:foo] = 3 | |
| p Thread.current[:foo] # prints 3 | |
| Fiber.new { | |
| Thread.current[:foo] = 4 | |
| p Thread.current[:foo] # prints 4 | |
| }.resume | |
| p Thread.current[:foo] # prints 3 |