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
| #!/bin/sh | |
| find /Applications /System/Library/CoreServices -not \( -name '*.lproj' -prune \) -name '*.app' | while IFS= read app; do apps="${app//\//\\/}"; plutil -convert xml1 -o - "$app"/Contents/Info.plist | sed -nEe '/<key>CFBundleURLSchemes<\/key>/,/<\/array>/ s/^.*<string>(.+)<\/string>/ \1:'" $apps/p"; done | sort |
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
| #!/bin/sh | |
| if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
| exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
| -- another way of waiting until an app is running | |
| on waitUntilRunning(appname, delaytime) | |
| repeat until my appIsRunning(appname) | |
| tell application "Messages" to close window 1 | |
| delay delaytime | |
| end repeat |
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
| from scene import * | |
| from PIL import Image | |
| import sound | |
| import random | |
| GAME_READY = 0 | |
| GAME_PLAY = 1 | |
| GAME_DYING = 2 | |
| GAME_DEAD = 3 |
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
| from scene import * | |
| from collections import namedtuple | |
| import copy | |
| import random | |
| class Vector2: | |
| def __init__(self, x = 0.0, y = 0.0): | |
| self.x = x | |
| self.y = y | |
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
| <?php | |
| curl_setopt_array( | |
| $chpush = curl_init(), | |
| array( | |
| CURLOPT_URL => "https://new.boxcar.io/api/notifications", | |
| CURLOPT_POSTFIELDS => array( | |
| "user_credentials" => 'ACCESS_TOKEN', | |
| "notification[title]" => 'message title', | |
| "notification[long_message]" => '<b>Some text or HTML for the full layout page notification</b>', |
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
| # Shows the location of the last photo in the canera roll in the Maps app. | |
| # (thanks to @HyShai for pointing out that the latitude/longitude refs are necessary) | |
| import photos | |
| import webbrowser | |
| meta = photos.get_metadata(-1) | |
| gps = meta.get('{GPS}') | |
| if gps: | |
| latitude = str(gps.get('Latitude', 0.0)) + gps.get('LatitudeRef', '') |
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
| #!/usr/bin/env python | |
| ''' | |
| recent_entries() will print out info on all posts to the Pythonista forum in the past 24 hours. | |
| watch_feed() will print out info on the last post to the Pythonista forum. | |
| Sleeps for 15 minutes then check to see if there is a newer post. | |
| If so, prints out info on it and opens its URL in the webbrowser. Repeat. | |
| ''' |
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 | |
| import Image | |
| import console | |
| im1 = clipboard.get_image(idx=0) | |
| im2 = clipboard.get_image(idx=1) | |
| background = Image.new('RGBA', (1300,1136), (255, 255, 255, 255)) | |
| def main(): |
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
| curl -d "user_credentials=ACCESS_TOKEN" \ | |
| -d "notification[title]=message title" \ | |
| -d "notification[long_message]=<b>Some text or HTML for the full layout page notification</b>" \ | |
| -d "notification[sound]=bird-1" \ | |
| https://new.boxcar.io/api/notifications |