Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# Usage: first run your apple health export through the scripts as documented in https://github.com/markwk/qs_ledger/tree/master/apple_health
# then run this script using the BodyMass.csv from this process to get an OpenScale csv
import argparse
import csv
import datetime
from dateutil.parser import parse as parsedate
@MoralCode
MoralCode / Pipfile
Last active February 23, 2021 05:06
mp3gifmerge
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
ffmpeg-python = "*"
[dev-packages]
@MoralCode
MoralCode / filter-by-image-width.sh
Last active January 30, 2021 03:57
A short bash script that non-recursively moves the current directory (which must contain all image files) based on their width.
rejectdir="../reject/lowres"
for filename in *
do
width=`identify -format "%w" $filename`
if [ $width -ne 2000 ]
then
mv "$filename" "$rejectdir"
bug: bug.c
gcc bug.c -lvc -o bug
@MoralCode
MoralCode / optimal_tsp.py
Last active May 7, 2019 17:33 — forked from westphahl/optimal_tsp.py
TSP brute-force solution in python3
"""
Author: Simon Westphahl <westphahl@gmail.com>
Description: Brute-force implementation for solving the TSP.
http://en.wikipedia.org/wiki/Travelling_salesman_problem
"""
routes = []
@MoralCode
MoralCode / MetricTime-Core.swift
Last active October 25, 2016 01:59
This is the very core of my MetricTime prank app which can be used/repurposed to convert regular time to Metric Time.
//This is the very core of my MetricTime prank app which can be used/repurposed to convert regular time to Metric Time.
//See the full app here: https://github.com/DeveloperACE/MetricTime
func convertTime(inputTime: (hour: Int, minute: Int, second: Int), toMetric:Bool = true) -> (hour: Int, minute: Int, second: Int) {
var millisecondsSinceToday = 0
var convertedTime = (hour: 0, minute: 0, second: 0)
if toMetric {