Requirements:
git clone https://github.com/anoved/ReadingListReader.gitbrew install coreutuilssudo brew link coreutilscd ReadingListReaderchmod +x readinglistreader.py
Command to run:
Requirements:
git clone https://github.com/anoved/ReadingListReader.gitbrew install coreutuilssudo brew link coreutilscd ReadingListReaderchmod +x readinglistreader.pyCommand to run:
| // based on http://avoidtheinevitable.wordpress.com/2013/01/21/instapaper-random-article-bookmarklet/ updated to | |
| // Instapaper's latest design. This only picks a random article from the first page of Instapaper items | |
| javascript:var l=document.querySelectorAll(".article_item .article_inner_item .host a");l[Math.floor(1+Math.random()*l.length)].click(); |
| #!/usr/bin/python | |
| import Image | |
| import base64, zlib | |
| # Jay Parlar convinced me to turn this data structure | |
| # from a dictionary into an object. | |
| class PackedImage(object): | |
| def __init__(self, mode, size, data): | |
| self.mode = mode |
| #!/usr/bin/python | |
| import Image | |
| import base64, zlib | |
| # Jay Parlar convinced me to turn this data structure | |
| # from a dictionary into an object. | |
| class PackedImage(object): | |
| def __init__(self, mode, size, data): | |
| self.mode = mode |
| <ol> | |
| <li>create a file called <code>filter.services.yml</code> file, with the following format: | |
| <code><pre> | |
| services: | |
| plugin.manager.filter: | |
| class: Drupal\modulename\Filter\FilterName | |
| arguments: ['@container.namespaces'] | |
| </pre></code> | |
| Replace <code>modulename</code> with the module's machine name, and <code>FilterName</code> with a unique name for the filter.</li> | |
| <li>create a folder called <code>lib/Drupal/modulename/Plugin</code> (replacing <code>modulename</code> with the module's machine name). In Mac and Unix environments, in the module's folder, you can use the following shell command: |
| import cgi, urllib, urlparse, webbrowser, sys, clipboard, console | |
| argLen = len(sys.argv) | |
| if argLen > 1: | |
| url = sys.argv[1] | |
| else: | |
| url = clipboard.get() | |
| p = urlparse.urlparse(url) |
| /* | |
| TODO: * An article that starts a sentence should be capitalized. | |
| * A more comprehensive list of subtleties like "a useful", "a once", "an hour", "an historical" | |
| * Tests | |
| */ | |
| exports.article = function(text) { | |
| var vowels = 'aeiou'; | |
| var an_exceptions = ['eucalyptus', 'eunuch', 'euphemism', 'euphemistic', 'euphonium', 'euphoric', 'european', 'once', 'one', 'onesie', 'union', 'unique', 'unison', 'united', 'useful', 'utopia', 'utopic', 'user', 'unicorn']; | |
| var a_exceptions = ['hour', 'historical', 'honorable', 'honourable']; | |
| if (a_exceptions.indexOf(text) != -1 || (vowels.indexOf(text.charAt(1)) == -1 && an_exceptions.indexOf(text) == -1)) { |
| # Duane Storey wrote an iPhone-friendly random password in PHP. | |
| # http://www.migratorynerd.com/tips/iphone-friendly-strong-password-generator/ | |
| # "Basically the idea is to only use mostly keys that are accessible without | |
| # having to hit shift or the keyboard button that switches to symbol mode." | |
| # This is a port to Python if you wanted to wanted to generate it using something | |
| # like Pythonista for iOS. http://omz-software.com/pythonista/ | |
| import random | |
| def generate_password(length = 10): |