Skip to content

Instantly share code, notes, and snippets.

View phillco's full-sized avatar

Phil Cohen phillco

View GitHub Profile
@phillco
phillco / WWDC.md
Created March 28, 2026 19:53 — forked from hishma/WWDC.md
WWDC 2015-2018 Session Videos

WWDC 2015-2018 Session Videos

For some reason some older WWDC session videos have been disappearing from Fruit Co's the developer site. Luckily Harish posted this this gist of URL's and titles. So I converted that JSON to this markdown doc.

Enjoy!

2018

  • 102 – Platforms State of the Union – 2018 Platforms State of the Union
  • 103 – Apple Design Awards – Join us for an unforgettable award ceremony celebrating developers and their outstanding work. The 2018 Apple Design Awards recognize state of the art iOS, macOS, watchOS, and tvOS apps that reflect excellence in design and innovation.
@phillco
phillco / handoff.py
Created August 15, 2024 00:36
Activate a handoff application in the dock with Talon
from talon import Module, actions, ui
mod = Module()
@mod.action_class
class Actions:
def dock_handoff_accept():
"""Accept a Handoff from another device via the dock"""
handoff_items = ui.apps(bundle="com.apple.dock")[0].element.children.find(
AXRole="AXDockItem", AXSubrole="AXHandoffDockItem"
import ollama
from talon.types import Span
OLLAMA_MODEL = "gemma2:2b"
def process_text(text, template):
print(f"Sending text to model: {text[:50]}...")
prompt = template.replace("$text", text)
try:
@phillco
phillco / electron_accessibility.py
Created August 9, 2023 22:22
Enable accessibility on electron apps in macOS
from talon import ui
from talon.mac.ui import App
from talon.ui import UIErr
APPS = [
"Slack",
"Google Chrome",
]
@phillco
phillco / focus.py
Last active August 22, 2023 01:00
Focusing window grammar
from talon import Context, Module, actions, app, ui
ctx = Context()
mod = Module()
mod.list("window_titles", desc="All window titles")
APPLICATION_MATCH_REGEX = re.compile("PyCharm|IntelliJ.*|TextEdit")
@phillco
phillco / pyast.py
Created February 22, 2022 07:00
Parsing/navigating through the Python AST with talon
import ast
import os.path
from talon import Context, Module, actions, ui
ctx = Context()
mod = Module()
# Stores the original AST elements so we can refer to specific properties of them
REFERENCE = {}
@phillco
phillco / ipython_magic_function_inspector.py
Created May 5, 2017 18:25 — forked from bradmontgomery/ipython_magic_function_inspector.py
An IPython Magic function that will pretty-print python objects with syntax highlighting.
"""
An IPython magic function to pretty-print objects with syntax highlighting.
See, "Defining your own magics":
http://ipython.org/ipython-doc/stable/interactive/reference.html#defining-your-own-magics
For more on Pygments:
http://pygments.org/docs/quickstart/
Usage
@phillco
phillco / setup.sh
Created March 7, 2016 22:42
Misc computer setup
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
[alias]
update-master=update-ref refs/heads/master refs/remotes/origin/master
@phillco
phillco / keybase.md
Created March 26, 2014 03:26
keybase.md

Keybase proof

I hereby claim:

  • I am phillco on github.
  • I am phillip (https://keybase.io/phillip) on keybase.
  • I have a public key whose fingerprint is C558 19D7 938B 78D6 D63A ED64 4BA7 568E 1AB9 2102

To claim this, I am signing this object: