Script moved ...
This file contains 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 .stack import find_stack, stack_resource_summary | |
def dynamodb_table_name(*logical_ids): | |
table_logical_id = logical_ids[-1] | |
stack_logical_ids = logical_ids[:-1] | |
stack = find_stack(stack_logical_ids) | |
resource = stack_resource_summary(stack, table_logical_id, 'AWS::DynamoDB::Table') | |
return resource.physical_resource_id |
This file contains 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 ui | |
from objc_util import ObjCClass, ObjCInstance, ns, create_objc_class, on_main_thread, ObjCBlock | |
from ctypes import c_void_p, CFUNCTYPE, Structure, cast, c_int, c_ulong, c_char_p, POINTER | |
import editor | |
import os | |
import zipfile | |
ASYNC = True | |
DRAG_PATH = editor.get_path() # Drag itself, ie. drag_provider.py | |
# DRAG_PATH = os.path.expanduser('~/Documents/Examples') # Drag ZIPpped folder |
This file contains 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 python3 | |
import os | |
import boto3 | |
from boto3.session import Session | |
import argparse | |
session = Session() | |
client = session.client('lambda') |
This file contains 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
{ | |
ColorModel = RGB; | |
DPIHeight = 72; | |
DPIWidth = 72; | |
Depth = 8; | |
Orientation = 1; | |
PixelHeight = 960; | |
PixelWidth = 1280; | |
ProfileName = "sRGB IEC61966-2.1"; | |
"{ExifAux}" = { |
This file contains 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
#!python3 | |
import unittest | |
import notification | |
# https://github.com/omz/Pythonista-Issues/issues/21 | |
class TestScheduledNotifications(unittest.TestCase): | |
delay = 300 # Keep it in the distant future, so, it won't fire during tests |
This file contains 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
#!python3 | |
import ui | |
from objc_util import ObjCInstance, ObjCClass, on_main_thread | |
from enum import Enum | |
from functools import partial | |
from collections import defaultdict | |
_LayoutConstraint = ObjCClass('NSLayoutConstraint') |
- Copy
forum-post-copy-code.py
script into the Pythonista - Go to Settings - Share Extension Shortcuts
- Tap on
+
button and addforum-post-copy-code.py
there - Open Safari, visit forum, find a topic & post with some code
- Make sure that URL ends with /NUMBER, like /5, /6, ... (it's a post number)
- Tap on action button in Safari
- Tap on Run Pythonista Script
- Tap on shortcut you did previously add
- All code elements are copied to the clipboard
This file contains 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
#!python3 | |
import base64 | |
import json | |
import appex | |
import clipboard | |
import objc_util | |
import photos | |
import requests |
This file contains 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 math | |
from scene import run, Scene, LabelNode, SpriteNode, Size, Point, Texture, Action | |
import secrets | |
from enum import Enum | |
class Direction(tuple, Enum): | |
UP = (-1, 0) # 1 row up, no column change |