Skip to content

Instantly share code, notes, and snippets.

View confluencepoint's full-sized avatar
:octocat:
Focusing

confluencepoint confluencepoint

:octocat:
Focusing
View GitHub Profile
@patrickwelker
patrickwelker / listurlschemes.sh
Last active October 28, 2016 23:30
Shell script to list all URL schemes from the apps installed on your Mac.
#!/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
@aktau
aktau / imessage
Last active February 25, 2025 15:56
Send iMessage from the commandline
#!/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
@BashedCrab
BashedCrab / JumpyOctopus.py
Created February 12, 2014 03:25
JumpyOctopus
from scene import *
from PIL import Image
import sound
import random
GAME_READY = 0
GAME_PLAY = 1
GAME_DYING = 2
GAME_DEAD = 3
@cloderic
cloderic / Steering.py
Created February 8, 2014 12:58
Steering agents in Pythonista
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
@mremond
mremond / boxcar_push.php
Created February 6, 2014 11:36
Send a Boxcar notification to your device in PHP
<?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>',
@omz
omz / ShowLastPhotoMap.py
Last active March 21, 2019 16:04
ShowLastPhotoMap
# 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', '')
@cclauss
cclauss / watch_pythonista_forum.py
Last active November 25, 2020 17:27
Learning how to use feedparser... 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.
#!/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.
'''
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():
@philgruneich
philgruneich / UpdatePinboardTags.py
Last active July 14, 2020 16:13
UpdatePinboardTags
#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else:
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