(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| 1 import urllib2 | |
| 2 import json | |
| 221 def basic_authorization(user, password): | |
| 222 s = user + ":" + password | |
| 223 return "Basic " + s.encode("base64").rstrip() | |
| 224 | |
| 225 def submit_pull_request(user, repo): | |
| 226 auth = (settings.username, settings.password) | |
| 227 url = 'https://api.github.com/repos/' + user + '/' + repo + '/pulls' |
| # This is a really old post, in the comments (and stackoverflow too) you'll find better solutions. | |
| def find(key, dictionary): | |
| for k, v in dictionary.iteritems(): | |
| if k == key: | |
| yield v | |
| elif isinstance(v, dict): | |
| for result in find(key, v): | |
| yield result | |
| elif isinstance(v, list): |
| Apple very usefully provides unauthenticated json feeds for both the iTunes search and iTunes rss | |
| The Search API returns your search results in JavaScript Object Notation (JSON) format. JSON is built on two structures: | |
| All JSON results are encoded as UTF-8. For more information on JSON, please see http://www.json.org. | |
| --- | |
| Search API | |
| http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html | |
| --- | |
| RSS Info |
| # This hosts file is brought to you by Dan Pollock and can be found at | |
| # http://someonewhocares.org/hosts/ | |
| # You are free to copy and distribute this file for non-commercial uses, | |
| # as long the original URL and attribution is included. | |
| #<localhost> | |
| 127.0.0.1 localhost | |
| 127.0.0.1 localhost.localdomain | |
| 255.255.255.255 broadcasthost | |
| ::1 localhost |
| http://[[list:App Store|Open=appstore.com/|Search=search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=[prompt:Query]|Top Paid=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=30|Top Free=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=27|Top Grossing=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=38]] | |
| http:// | |
| [[ | |
| list:App Store | |
| |Open=appstore.com/ | |
| |Search=search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=[prompt:Query] | |
| |Top Paid=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=30 | |
| |Top Free=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=27 | |
| |Top Grossing=itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTop?genreId=36&popId=38 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Paste Image</title> | |
| <script type="text/javascript"> | |
| var imageObj = new Image(); | |
| window.onload = function() { | |
| document.getElementById("pasteTarget"). | |
| addEventListener("paste", handlePaste); | |
| var canvas = document.getElementById('canvasTarget'); |
| # Same as before, with a kivy-based UI | |
| ''' | |
| Bluetooth/Pyjnius example | |
| ========================= | |
| This was used to send some bytes to an arduino via bluetooth. | |
| The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
| tested without BLUETOOTH_ADMIN, maybe it works.) |
| from PySide import QtCore, QtGui | |
| import sys | |
| app = QtGui.QApplication(sys.argv) | |
| QtGui.qApp = app | |
| folderTree = QtGui.QTreeWidget() | |
| header = QtGui.QTreeWidgetItem(["Virtual folder tree","Comment"]) | |
| #... |