This file contains hidden or 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
%snippet:marked.min.js% // import marked.min.js library | |
marked(TextExpander.pasteboardText).replace(/(\n)+/g, ''); |
This file contains hidden or 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
tweetbot:///mute/keyword?regex=1&text=Angels%7CAstros%7CAthletics%7CBlue%20Jays%7CBraves%7CBrewers%7CCardinals%7CCubs%7CDiamondbacks%7CDodgers%7CGiants%7CIndians%7CMariners%7CMarlins%7CMets%7CNationals%7COrioles%7CPadres%7CPhillies%7CPirates%7CRangers%7CRays%7CRed%20Sox%7CReds%7CRockies%7CRoyals%7CTigers%7CTwins%7CWhite%20Sox%7CYankees |
This file contains hidden or 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
// This script is specifically designed to be used with TextExpander for both iOS and OS X. | |
myTag = 'soitscometothis-20'; | |
var currentURL = TextExpander.pasteboardText; | |
var re = /^.*\/([A-Z0-9]{10}).*$/; | |
var found = currentURL.match(re); | |
if (!found) { | |
cleanedURL = currentURL; | |
} else { |
This file contains hidden or 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
var date = new Date().toISOString().replace(/(\d+-\d+-\d+).+/gm,'$1 '); | |
draft.content = draft.content.replace(/^/gm,date); |
This file contains hidden or 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
# Inspired by Dr. Drang's TextExpander snippet for adding iTunes affiliate code to URl. http://www.leancrew.com/all-this/2013/08/new-apple-affiliate-link-scripts/ | |
# Modified for Pythonista. | |
from sys import stdout | |
import clipboard, console, webbrowser, urllib | |
# My affiliate ID. | |
myID = '11l4RT' | |
tweetText = console.input_alert("", "Enter Tweet text.", "", "Awesome") |
This file contains hidden or 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 photos | |
import Image | |
import console | |
im1 = photos.pick_image(show_albums=False) | |
im2 = photos.pick_image(show_albums=False) | |
width1, height1 = im1.size | |
width2, height2 = im2.size |
This file contains hidden or 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 photos | |
from dropboxlogin import get_client | |
dropbox_client = get_client() | |
import keychain | |
import console | |
import time | |
import httplib | |
from io import BytesIO | |
import datetime | |
import webbrowser |
This file contains hidden or 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
""" | |
This code takes two screenshots from the camera roll combines them into one image and saves the new image to the camera roll. | |
This is adapted from Federico Viticci's blog post at: | |
http://www.macstories.net/stories/automating-ios-how-pythonista-changed-my-workflow/ | |
It removes the option to change which picture is where, automatically assigning the first one chosen as the leftmost image. | |
It also removes the necessity to copy the images to the clipboard outside of Pythonista using the new photos library in version 1.3. Finally, it removes the clipboard output. | |
""" | |
import photos |
This file contains hidden or 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 clipboard, console, re | |
mytext = clipboard.get() | |
# User input text | |
matchedText = console.input_alert("Find", "Enter text/regex to find.") | |
replacedText = console.input_alert("Replace", "Enter text to replace.") | |
# Regex find and replace | |
mytext = re.sub(matchedText, replacedText, mytext, flags=re.MULTILINE) |