Skip to content

Instantly share code, notes, and snippets.

@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 / 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);
@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 / 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 / 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 / CondaExampleWithOpenMM.ipynb
Last active April 22, 2021 16:32
Using OpenMMTools in Google Colab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -e
## Build all recipes in the adequate order
conda build --python=2.7 -c local -c insilichem tangram_libtangram
echo "*************************************"
echo "*************************************"
echo "*************************************"
conda build --python=2.7 -c local -c insilichem tangram_gaudiview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimergp
jaimergp / jaimergp.flatland-monokai-improved.json
Created June 9, 2018 17:38
Custom modifications to Flatland Monokai Improved (for markup, mainly)
{
"name": "Flatland Monokai Improved",
"colors": {
"activityBar.background": "#26292C",
"activityBarBadge.background": "#36a3d9",
"button.background": "#36a3d9",
"editor.background": "#26292C",
"editor.foreground": "#F8F8F2",
"editor.selectionBackground": "#5a5a5a",
"editorCursor.foreground": "#ff953f",
@jaimergp
jaimergp / userChrome.css
Created November 26, 2017 17:17
My Firefox Quantum userChrome.css
/* Place in ~/.mozilla/firefox/<profile_id>/chrome */
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Show bookmarks toolbar on New Tab only */
#PersonalToolbar {
visibility:collapse;
}
#main-window[title="Mozilla Firefox"] #PersonalToolbar,
#main-window[title="Mozilla Firefox"] #PersonalToolbar #personal-bookmarks #PlacesToolbar,
#main-window[title^="New Tab"] #PersonalToolbar,