Skip to content

Instantly share code, notes, and snippets.

View viticci's full-sized avatar

Federico Viticci viticci

View GitHub Profile
@omz
omz / Dropbox File Picker.py
Last active May 17, 2020 21:47
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@drdrang
drdrang / Cleanbar.py
Last active July 6, 2017 20:28
Clean up the statusbar of an iOS screenshot. The time in the statusbar is maintained, but all other graphics are stripped out and replaced with graphics that show full battery and signal strength. The cellular provider is replaced with the Apple logo, . All graphics are built into the script, which works for any Retina iOS device in any orienta…
#!/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/env python3
from os.path import expanduser
from urllib import request
from urllib import parse
import json
import sys
API_URL = "https://feedwrangler.net/api/v2/"
import requests
CLIENT_KEY=""
EMAIL=""
PASSWORD=""
AUTHORIZE_ENDPOINT="http://feedwrangler.net/api/v2/users/authorize?email=%s&password=%s&client_key=%s" % (EMAIL, PASSWORD, CLIENT_KEY)
authorize = requests.get(AUTHORIZE_ENDPOINT)
access_token = authorize.json()['access_token']
@fcrespo82
fcrespo82 / SearchGooglePlaces.py
Last active September 29, 2021 23:01
Python script for pythonista (iOS app) to search google places API and open the first result in Apple Maps
# -*- coding: utf-8 -*-
import requests, json, webbrowser, urllib, sys
API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Get your api key from https://code.google.com/apis/console/, you MUST add the Places API permission to it
GOOGLE_PLACES_URI = 'https://maps.googleapis.com/maps/api/place/textsearch/json?query={0}&sensor=false&key={1}'
APPLE_MAPS_URI = 'safari-http://maps.apple.com/?q={0}'
#call this script in pythonista for ios pythonista://GoogleToAppleMaps?action=run&argv=[prompt]
def main():
This gist contains a workflow for Editorial, an app for
writing plain text and markdown on iOS.
To import the workflow, copy the *entire* text of the gist,
then open Editorial and create a new workflow.
------------ BEGIN WORKFLOW ------------
{
"actions" : [
{
@gvvaughan
gvvaughan / MD Title Extract.py
Created January 22, 2013 06:13
MD Title Extract
import re
g = re.search ('\[[^\]]*\]\(.*"([^"]*)"\)','[foo](bar.com "Title")')
print (g.group(1))
@cormacrelf
cormacrelf / things_parsedate.py
Last active July 25, 2016 00:40
Parse a natural language date and use that as the due date for a new Things task. Depends on https://gist.github.com/4583376
# Date parsing for Things
# by Cormac Relf - cormacrelf.com - @cormacrelf
# depends on parsedatetime
# use the .py files extracted from v0.8.7 from here: https://gist.github.com/4583376
# alternatively:
# download pipista; https://gist.github.com/4116558
# in the plain Pythonista console, type `import pipista`, then `pipista.pypi_download("parsedatetime")`
# download shellista; https://gist.github.com/4139094
# running shellista, enter the following commands, which have been shortened for your convenience:
@cormacrelf
cormacrelf / OpenURL.py
Created January 20, 2013 13:35
open url in safari from pythonista
# a bit of a hack
# by Cormac Relf - cormacrelf.com - @cormacrelf
# Opens the url on the clipboard in Safari
# by opening Google Chrome with an x-callback-url
# that takes you to the same url in Safari.
# I guess you could just open it in googlechrome://
import webbrowser
{
"actions" : [
{
"class" : "WorkflowActionRequestTextInput",
"parameters" : {
"multiLineOption" : 1,
"title" : "Append to Scratch"
}
},
{