This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
from random import choice | |
def opposite(d): | |
return (d[0]*-1, d[1]*-1) | |
def sub_tuples(a, b): | |
return (a[0]-b[0], a[1]-b[1]) | |
def add_tuples(a, b): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PLEASE READ THESE FEW LINES | |
## You can contact at @theknowsbest on Twitter if you need help (though admittedly, I'm far from an expert on this stuff) | |
## Before you can use this script, you need to do a few things... | |
## 1. Create a Dropbox app for Python through 'http://dropbox.com/developers/apps' | |
## 2. Run the first script on this site 'http://omz-software.com/pythonista/docs/ios/dropbox.html' | |
## Make sure to insert your app key and secret, | |
## and follow the instructions you're given in the console slavishly | |
## 3. Download this 'https://gist.github.com/4034526' script and name it 'dropboxlogin.py' | |
## 4. Run 'dropboxlogin.py' and authenticate your app through | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Hydrogen is a lightweight GUI framework for Pythonista | |
# | |
# Hydrogen - https://gist.github.com/BashedCrab/5924965 | |
# | |
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019 | |
# | |
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Hydrogen is a lightweight GUI framework for Pythonista | |
# | |
# Hydrogen - https://gist.github.com/BashedCrab/5924965 | |
# | |
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019 | |
# | |
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Clone or update all a user's gists | |
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python | |
# USER=fedir python gist-backup.py | |
import json | |
import urllib | |
from subprocess import call | |
from urllib import urlopen | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drafts://x-callback-url/import_action?type=URL&name=Search%20in%20Pinboard&url=https%3A%2F%2Fm.pinboard.in%2Fsearch%2F%3Fquery%3D%5B%5Bdraft%5D%5D%26mine%3DSearch%2BMine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/4702275 | |
# | |
# All-purpose gist tool for Pythonista. | |
# | |
# When run directly, this script sets up four other scripts that call various | |
# functions within this file. Each of these sub-scripts are meant for use as | |
# action menu items. They are: | |
# | |
# Set Gist ID.py - Set the gist id that the current file should be | |
# associated with. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser, os, pprint | |
# Include the Dropbox SDK libraries | |
#from dropbox import client, rest, session | |
import dropbox | |
# Configuration | |
TOKEN_FILENAME = 'PythonistaDropbox.token' | |
# Get your app key and secret from the Dropbox developer website | |
APP_KEY = '<your dropbox app_key>' | |
APP_SECRET = '<your dropbox app_secret>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, cmd, sys, re, glob, os.path, shutil, zipfile, tarfile, gzip | |
# Credits | |
# | |
# The python code here was written by pudquick@github | |
# | |
# License | |
# | |
# This code is released under a standard MIT license. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import pickle | |
import console | |
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder | |
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')] | |
import dropboxlogin # this code can be found here https://gist.github.com/4034526 | |
STATE_FILE = '.dropbox_state' |
NewerOlder