Skip to content

Instantly share code, notes, and snippets.

import feedparser
import time
import datetime
from dateutil import tz
import re
import httplib
import urllib
DROPBOX_PERSONAL_FEED = ''
DROPBOX_WORK_FEED = ''
@drdrang
drdrang / clockface
Last active August 4, 2016 21:13
Prints Emoji clockface of the given time rounded to the nearest half-hour. Uses current time if none given. After https://github.com/RobTrew/txtquery-tools/blob/master/utilities/emotime.sh
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sys import argv
from time import strftime
clocks = {'12:00': '🕛', '12:30': '🕧', '1:00': '🕐', '1:30': '🕜',
'2:00': '🕑', '2:30': '🕝', '3:00': '🕒', '3:30': '🕞',
'4:00': '🕓', '4:30': '🕟', '5:00': '🕔', '5:30': '🕠',
'6:00': '🕕', '6:30': '🕡', '7:00': '🕖', '7:30': '🕢',
@CleanShavenApps
CleanShavenApps / DispatchComposeURLScheme.md
Last active August 27, 2022 20:50
/compose URL scheme for Dispatch mail app (www.dispatchapp.net)

Dispatch registers the x-dispatch:// URL scheme and provides one public action: compose.

/compose overview

Launches Dispatch with the composer screen prefilled using information provided in the parameters below.

from

Optional. Specifies the email address of the account to compose the new mail from. If there are more than one account configured in Dispatch, and no valid from account is provided, Dispatch will default to using the first account configured in Dispatch to compose the mail.

@epramono
epramono / LCP2.1URLSchemes
Last active December 31, 2015 03:39
Comparing the URL Schemes supported by Launch Center Pro 2.0 and 2.1.
launchpro-light:
launch://light
launchpro-brightness://toggle?low=10&high=100
launch://brightness/toggle?low=40&high=60
launchpro-dial:
launch://dial
launchpro-clipboard://convert?format=
@hiilppp
hiilppp / list.py
Created December 10, 2013 01:11
Python script to manipulate text in Pythonista in the following manner and send the result (back) to Drafts: Sort lines, remove blank and duplicate lines, and prepend a hyphen to lines which don't start with one.
# To call script from Drafts, use the follwing URL as URL Action:
# <pythonista://list.py?action=run&argv=[[draft]]>
import os
import re
import sys
import urllib
import webbrowser
a = re.sub(r"(?m)^[*-] ", "", sys.argv[1])
@sgerin
sgerin / gist:6265532
Created August 19, 2013 03:25
Get OS X icons. Thanks to Brett Terpstra.
# Adapted from Brett Terpstra script : http://brettterpstra.com/2013/04/28/instantly-grab-a-high-res-icon-for-any-ios-app/
# Fetches the 1024px version of an OS X app icon. The result is displayed in Pythonista's console, you can tap and hold to save or copy it.
# If you find any bug, you can find me @silouane20 on Twitter.
from PIL import Image
from StringIO import StringIO
import re
import requests
def find_icon(terms):
@sgerin
sgerin / ios_icons
Created August 19, 2013 03:18
Get iOS icons. Thanks to Brett Terpstra.
# Adapted from Brett Terpstra script: http://brettterpstra.com/2013/04/28/instantly-grab-a-high-res-icon-for-any-ios-app/
# Gets the 1024px version of an app icon and applies a rounded mask. The result is displayed in Pythonista's console, you can tap and hold to save or copy it.
# You may find odd result: try searching for both device categories.
# If you find any bug, you can find me @silouane20 on Twitter.
from PIL import Image
from StringIO import StringIO
import re
import requests
@aquarius
aquarius / gist:5823110
Last active April 5, 2019 13:10
MindNode URL Schemes

#MindNode URL Schemes

Basic

###Launch MindNode mindnode://

####Examples mindnode://

###Open Document

@benwaldie
benwaldie / 2012-11-16-TUAW_Waldie.applescript
Created November 19, 2012 20:35
TUAW - Create Evernote Template Notebook
-- Get the path to the Evernote templates folder
set theTemplatesFolder to (path to documents folder as string) & "Evernote Templates:" as alias
-- Retrieve a list of template file names without their .enex extensions
set theTemplateNames to list folder theTemplatesFolder without invisibles
repeat with a from 1 to length of theTemplateNames
set aTemplate to item a of theTemplateNames
if aTemplate contains ".enex" then set aTemplate to text 1 thru -6 of aTemplate
set item a of theTemplateNames to aTemplate
end repeat
@omz
omz / dropboxlogin.py
Created November 7, 2012 21:16
dropboxlogin
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!
# Go to dropbox.com/developers/apps to create an app.
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
# access_type can be 'app_folder' or 'dropbox', depending on
# how you registered your app.
access_type = 'app_folder'