Skip to content

Instantly share code, notes, and snippets.

View telamonian's full-sized avatar

Max Klein telamonian

View GitHub Profile
@telamonian
telamonian / singleton.py
Created November 29, 2017 20:24 — forked from werediver/singleton.py
A thread safe implementation of singleton pattern in Python. Based on tornado.ioloop.IOLoop.instance() approach.
import threading
# Based on tornado.ioloop.IOLoop.instance() approach.
# See https://github.com/facebook/tornado
class SingletonMixin(object):
__singleton_lock = threading.Lock()
__singleton_instance = None
@classmethod
A fix that enables Pymol and the OSX native Aqua windowing system
to play nicely together. By Max Klein, [email protected]
The complete code for this patch can be found on GitHub at
https://github.com/telamonian/pymol/tree/osx_gui_fix_-_invert_threads
Notes:
* Low level Apple libraries (Core Services) strictly enforce a rule
that only a program's main thread may initialize/interact with Tkinter
Aqua application windows.
@telamonian
telamonian / gist:875affc6e16cba8b8be08850c982555a
Created August 12, 2016 23:40
Working around SSL certificate issues in homebrew cask
Today I tried to install latexit using brew cask but couldn't:
$ brew cask install latexit
...
curl: (60) SSL certificate problem: Invalid certificate chain
...
Error: Download failed on Cask 'latexit' with message: Download failed: https://www.chachatelier.fr/latexit/downloads/LaTeXiT-2_8_1.dmg
Turns out that https://www.chachatelier.fr let their SSL certificate expire about a week ago. I still wanted to install latexit using brew, so here's what I did: