Skip to content

Instantly share code, notes, and snippets.

@jaimergp
jaimergp / config-highlight.cfg
Last active July 28, 2023 14:39
Dark highlighting theme for Python IDLE based on SublimeText's Monokai color scheme
# Place this file inside your ~/.idlerc/ folder
# or paste its contents inside
# /path/to/python/idlelib/config-highlight.def
# Adapted from SublimeText's Monokai
[monokai]
normal-foreground= #F8F8F2
normal-background= #272822
keyword-foreground= #F92672
keyword-background= #272822
@jaimergp
jaimergp / chimera_cli.py
Last active February 6, 2016 16:06
Use UCSF Chimera IDLE directly in terminal, no GUI
"""
Experimental wrapper to use Chimera's Python directly from console.
You can `import chimera` with no errors!
Usage
=====
1. Alias your /path/to/chimera/bin/python binary to something more user-friendly, like `chimerapy`.
2. Download these two files and put them together
3. Run `chimerapy -i chimera_cli.py`. (Tip: Realias `chimerapy` to this command).
@jaimergp
jaimergp / center_protein.vmd
Created January 18, 2016 09:33
Center MD protein in PBC box with VMD
######################################################################
### Center multi-unit protein in pbc box with VMD
### Make sure you are in first frame of MD
######################################################################
# Join separate units for this first frame only
pbc join connected -now
pbc join residue -now
# Join the protein for all MD
@jaimergp
jaimergp / trello-tvdb-banners.ipynb
Created February 6, 2016 16:03
Trello Series board banners with TVDB
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimergp
jaimergp / conda.fish
Last active May 19, 2016 18:36
Fish completions for conda
# Autocompletions for conda commands
# Place this file in ~./config/fish/completions/
# Original implementations, but slow
# function __fish_conda_commands
# command conda help | awk '/^ \S/ {print $1}'
# end
# function __fish_conda_envs
# command conda env list | awk 'NR > 2 {print $1}'
# end
@jaimergp
jaimergp / fotologbackup.py
Last active April 14, 2021 04:09
Download your entire Fotolog to disk, comments included [DEPRECATED]
#!/usr/bin/env python
# encoding: utf-8
"""
Download your entire Fotolog to disk, comments included
@jaimergp, 2016
Dependencies: requests, beautifulsoup4
"""
@jaimergp
jaimergp / ProgrammaticNotebook.ipynb
Last active May 28, 2016 19:52 — forked from fperez/ProgrammaticNotebook.ipynb
Creating an IPython Notebook programatically
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimergp
jaimergp / clear_recent_files_chimera.py
Created June 2, 2016 13:47
Clear recent files in UCSF Chimera Rapid Access panel
#!/usr/bin/env python
import os
from shutil import copy
from pprint import pprint
path = os.path.expanduser("~/.chimera/preferences")
copy(path, path + ".bak") # just in case
with open(path) as f:
data = f.read()
@jaimergp
jaimergp / pychimera_screenshots.py
Created September 8, 2016 17:48
Headless render images of molecules with PyChimera
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import pychimera
import os
# os.environ['CHIMERADIR'] = '/path/to/headless/chimera'
pychimera.patch_environ()
pychimera.enable_chimera()
@jaimergp
jaimergp / GAUDI Movies.ipynb
Created March 14, 2017 11:51
Create movies from GAUDI solutions with pychimera & gaudiview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.