Skip to content

Instantly share code, notes, and snippets.


Ian Joicey Phuket2

  • Pattaya, Thailand
View GitHub Profile
Phuket2 /
Created Aug 24, 2018
Launch Application - For Alfred Workflow
Launch Application (Emulate standard Alfred operation)
+ Requires Alfred Powerpack and Version 3+
A script meant to be used in Alfred Script Filter(Input) within
a workflow that is connected to a 'Open File' (Action)
looks for entries with ext '.app' in the directories in the _dir_list.
Creates a list of dicts as per the Alfred Documentation and returns
Phuket2 /
Created Aug 5, 2018
Recreate table cursor in toga
import toga
from import *
def table_callback(widget, **kwargs):
x = kwargs.get('row')._source
class MyApp(toga.App):
def startup(self):
self.main_window = toga.MainWindow(
Phuket2 /
Created Nov 27, 2017
# coding: utf-8
import ui
import io
import editor
import console
import dialogs
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.styles import get_all_styles
Phuket2 / MobilePlatormSurvey.json
Last active Nov 24, 2017
View MobilePlatormSurvey.json
"frame": "{{0.0,44.0},{320.0,320.0}}",
"class": "View",
"nodes": [
"frame": "{{21.0,20.0},{279.0,45.0}}",
"class": "Label",
"attributes": {
"flex": "",
this is crap. i mashed to files together without editing.
but it could be something. i have just been to lazy to bring it
together. i use it the wrench menu myself.
it acually works for me as a quickie when i am looking for a script.
import ui, editor, console, editor
import io, re
import ui
# only use this func to create a button for convienience
def quick_button(p, title="", **kwargs):
# p is the parent view
_inset = 60
btn = ui.Button(name='btn', **kwargs)
btn.frame = ui.Rect(0, 0, p.width, p.width).inset(_inset, _inset)
btn.corner_radius = btn.width / 2 =
import ui
from random import choice
_color_list = ['purple', 'orange', 'deeppink', 'lightblue', 'cornflowerblue'
'red', 'yellow', 'green', 'pink', 'navy', 'teal', 'olive',
'lime', 'maroon', 'aqua', 'silver', 'fuchsia',
import ui
import dialogs
import datetime as dt
class FormDialogWrapper(object):
A Wrapper/Helper class around the dialogs.form_dialog
Does it need one?? Maybe not. But by attempting to do one, I learn more
about the form_dialog.
To me these wrappers/helps also seem such a good idea in the begining. Then I get
****** WRENCH ITEM ******
create notes for the current source file in the Pythonisita Editor
This file should be added to the wrench menu, and will be run on the active editor tab
The idea is simple. just sometimes you want to make notes as you working on a file. This
script just automates creating a sub dir to save a notes file as well as file by the
same name, but different ext. The ext can be changed below.
A dir will be created in the directory of the source file if one does not exit,
# Pythonista Forum - @Phuket2
import ui, editor
from collections import deque, namedtuple
# maybe silly, but each view created in here, we add a dynamic attr
# called vid (view id) to each view. i use it in add_labels_to_sv, a
# debug function, not sure how much more useful it can be.
# ammendment, also use in subviews_as_tuples, in this case, its handy
_v_id = 1