Skip to content

Instantly share code, notes, and snippets.

@jaimergp
jaimergp / cf-workon.sh
Created November 12, 2025 14:12
A handy bash function to work on conda-forge feedstocks
#!/bin/bash
# Set your GitHub username here
GH_USERNAME="REPLACE_ME"
DEVEL_DIR="${HOME}/devel"
conda_fork_clone_branch() {
local feedstock_name="$1"
local new_branch_name="$2"
local feedstock_repo="${feedstock_name}-feedstock"
@jaimergp
jaimergp / config-highlight.cfg
Last active July 19, 2025 13:09
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 / 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 / README.md
Created January 22, 2024 12:28
Zero-to-hero to Hevy

From Zero To Hero to Hevy

I had been using Zero To Hero for years to track my workouts. The app has not seen development in a while.

You can backup your ZTH data to a Realm database via the app. This .zth file can be exported to a JSON with the attached Node.js script (you need npm install realm).

Then the JSON can be post-processed into a CSV file following the Strong app format (I took this sample).

@jaimergp
jaimergp / ghstats.py
Created November 15, 2019 14:42
Calculate some stats for all repos in a GitHub organization
#!/usr/bin/env python
# coding: utf-8
"""
PyStats
-------
Stats of Python packages. Includes data of GitHub Repository &
Anaconda downloads (if available).
@jaimergp
jaimergp / better-harvest.js
Last active February 25, 2023 14:24
Add this as a bookmarklet (`javascript:<Paste this gist>`) to add some features to Harvest web UI
var table = document.getElementsByClassName("week-view-table")[0];
table.style.borderCollapse = "collapse";
var trs = document.getElementsByClassName("week-view-entry");
var curr_id = "0";
var curr_cum_hours = 0;
var curr_cum_mins = 0;
var total_length = trs.length;
var i = 0;
function addTotalRow(table, tr, pos, hours, mins) {
var new_row = table.insertRow(pos+1);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimergp
jaimergp / retry_magic.py
Created September 11, 2020 08:47
Jupyter IPython magic to retry cell executions - based on %timeit. This hasn't been tested thoroughly!
import ast
import time
from IPython.core.magic import (
Magics,
magics_class,
cell_magic,
needs_local_scope,
no_var_expand,
)
@jaimergp
jaimergp / tilde_backslash.json
Created December 29, 2021 12:20
Karabiner config for missing backslash keys on US keyboards with Spanish ISO layouts
{
"title": "Option+tilde to backslash",
"rules": [
{
"description": "ROption+tilde inserts backslash",
"manipulators": [
{
"type": "basic",
"from": {
"modifiers": {
@jaimergp
jaimergp / CondaExampleWithOpenMM.ipynb
Last active April 22, 2021 16:32
Using OpenMMTools in Google Colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.