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 / 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 / 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 / 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);
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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,