Skip to content

Instantly share code, notes, and snippets.

View bwagner's full-sized avatar

Bernhard Wagner bwagner

  • Zürich
  • LinkedIn in/bernhardw
View GitHub Profile
@bwagner
bwagner / HTMLClipboard.py
Last active April 28, 2023 13:55 — forked from Erreinion/HTMLClipboard.py
HTMLClipboard with updates for Python 3. Includes exception handling for locked clipboard. Improvement of: http://code.activestate.com/recipes/474121/
#!/usr/bin/env python
"""
Created on Sep 24, 2013
@author: RandomHardcoreJerks
Requires pywin32
original: http://code.activestate.com/recipes/474121/
@bwagner
bwagner / clip_magic.py
Last active August 5, 2023 10:22 — forked from cphyc/clip_magic.py
copy to clipboard ipython magic
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
updated version: https://gist.github.com/bwagner/270da7c7d31af7ffaca32674557fc172
Example usage:
-- Adapted from http://www.macosxhints.com/article.php?story=20031018154841400
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Sharing" of menu "View" of menu bar 1
delay 2