Skip to content

Instantly share code, notes, and snippets.

Parsing Apple Health data

If you’ve ever wanted to analyze your own health data, here’s how.

Exporting as XML

  1. Open the Health app.
  2. Tap on your profile in the top right.
  3. Tap Export All Health Data.
  4. Share the archive with yourself (e.g. via AirDrop, Files, Mail, etc.).
@daemonp
daemonp / encrypted-root-arch-linux-pixelbook.md
Last active May 2, 2024 16:01
Installing Arch Linux on a Google Pixelbook (i7 16gb 500gb NVMe)

Overview

Stable enough for my initial use-case, light-duty laptop for travel and presentations, running Linux all the time but retain a small ChromeOS volume for firmware updates and restoring settings.

1st attempt I wiped the drive and then found that when the machine attempted to suspect when the lid closed it wiped the NVRAM with no other option to boot into legacy mode than to restore ChromeOS and enable it again.

  • Setup base system in ChromeOS
  • Fully encrypted Btrfs root partition & ext4 boot
  • Install Arch Linux
@yoki
yoki / html2markdown.py
Created May 23, 2016 05:19
Convert html file to markdown
def html2markdown(self, html):
# convert html to markdown.
# specification:
# remove all tag exccept tags listed in the cleanbody._repl
# when p/div tags are in the table tag, markdown converter (htmlformatter)
# confuses. so it is removed
# we need following in the header
# import re, html2text
# from bs4 import BeautifulSoup
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 2, 2024 15:55
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dkittell
dkittell / PictureRename.ps1
Last active May 2, 2024 15:54
PowerShell – Rename Pictures to Image Taken Date/Time with Dimensions
<#
.SYNOPSIS
Renames pictures.
.DESCRIPTION
The Rename-Pictures cmdlet to rename pictures to a format where the file creation time is first
in the name in this format: . The idea is that
.PARAMETER Path
Specifies the path to the folder where image files are located. Default is current location (Get-Location).
@sebsto
sebsto / install_ld.gold.sh
Last active May 2, 2024 15:52
Installl `ld.gold` on Amazon Linux 2023
#!/bin/bash
dnf install gmp-devel mpfr-devel texinfo bison git gcc-c++ -y
mkdir ld.gold && cd ld.gold
git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils
mkdir build && cd build
../binutils/configure --enable-gold --enable-plugins --disable-werror
make all-gold
cd gold
@mandarinx
mandarinx / NormalsVisualizer.cs
Last active May 2, 2024 15:52
Visualize mesh normals in Unity3D
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MeshFilter))]
public class NormalsVisualizer : Editor {
private const string EDITOR_PREF_KEY = "_normals_length";
private Mesh mesh;
private MeshFilter mf;
private Vector3[] verts;
@davemackintosh
davemackintosh / .htaccess
Last active May 2, 2024 15:52
Working .htaccess for Single Page Apps
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>
@fnky
fnky / ANSI.md
Last active May 2, 2024 15:51
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@sainnhe
sainnhe / gruvbox-material-alacritty.yml
Last active May 2, 2024 15:49
Gruvbox Material for Alacritty
# The definition of color schemes.
schemes:
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
primary:
background: '0x1d2021'
foreground: '0xd4be98'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'