Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active October 31, 2025 14:00
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@grcatlin
grcatlin / apple_watch.R
Created March 15, 2023 20:47
Apple Watch Data in R
library(XML)
library(data.table)
library(lubridate)
library(ggplot2)
library(stringr)
library(leaflet)
# import and divide xml file ----------------------------------------------
# import
import xmltodict
import json
import numpy as np
import pandas as pd
#Parse XML to dictionary
with open('export.xml') as f:
health = xmltodict.parse(f.read())
#Extract desired data and turn into a Data Frame
@andrewrk
andrewrk / 1-brute-force.c
Created May 1, 2019 21:58
cleanup code techniques
int main(int argc, char **argv) {
struct SoundIo *soundio = soundio_create();
if (!soundio) {
fprintf(stderr, "out of memory\n");
return 1;
}
int err;
if ((err = soundio_connect(soundio))) {
fprintf(stderr, "unable to connect: %s\n", soundio_strerror(err));
soundio_destroy(soundio);
@ryanpraski
ryanpraski / apple_health_load_analysis_R.r
Last active April 30, 2023 21:08
Load Apple Health Kit export.xml file in R then analyze and visualize Steps Data using R. See the full post here: http://www.ryanpraski.com/apple-health-data-how-to-export-analyze-visualize-guide/
library(dplyr)
library(ggplot2)
library(lubridate)
library(XML)
#load apple health export.xml file
xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml")
#transform xml file to data frame - select the Record rows from the xml file
df <- XML:::xmlAttrsToDataFrame(xml["//Record"])
@alejio
alejio / SQLite_save.Rd
Created August 1, 2015 18:08
R: Save data frame to SQLite db
require("RSQLite")
# Set up database
drv <- dbDriver("SQLite")
tfile <- "Iowa.db"
con <- dbConnect(drv, dbname = "Iowa.db")
dbWriteTable(con, "data1", as.data.frame(data1))
dbDisconnect(con)
@xpepper
xpepper / Some tools and tweaks on Mac OS X.md
Last active May 6, 2025 14:52 — forked from g3d/gist:2709563
Some tools and tweaks on Mac OS X