Skip to content

Instantly share code, notes, and snippets.

@katemonkeys
katemonkeys / gist:e17580777b57915f5068
Last active May 6, 2024 16:16
Everything Wrong With The Withings API

Top Six Things You Need To Know About The Withings API*

*where “you” is probably a developer, or at least a strange user

I should preface this by saying that I got a Withings Smart Body Analyzer for Christmas last year and I’ve been generally happy with it. It purports to be able to take my heart rate through my bare feet and that seems not to work for my physiology, but overall I’m a fan. If if their Wikipedia page is to be believed they are having a pretty rad impact on making the Quantified Self movement more for normal people and they only have 20 full time employees. Also they try hard to use SI units, which I can get behind. Anyway, on to the rant.

I originally called this post “Everything wrong with the Withings API” and I meant it. For every useful field I can extract from their “award winning” app, I have spent an hour screaming at the inconsistencies in their implementation or inexplicable holes in their data

;; Auto-scrolling ==============================================================
(defn scroll! [el start end time]
(.play (goog.fx.dom.Scroll. el (clj->js start) (clj->js end) time)))
(defn scrolled-to-end? [el tolerance]
;; at-end?: element.scrollHeight - element.scrollTop === element.clientHeight
(> tolerance (- (.-scrollHeight el) (.-scrollTop el) (.-clientHeight el))))
(defn autoscroll-list [{:keys [children class scroll?] :as opts}]
@nberger
nberger / reagent_infinite_scroll.cljs
Last active May 6, 2024 16:15
Reagent infinite scroll
(ns views.infinite-scroll
(:require
[reagent.core :as r]))
(defn- get-scroll-top []
(if (exists? (.-pageYOffset js/window))
(.-pageYOffset js/window)
(.-scrollTop (or (.-documentElement js/document)
(.-parentNode (.-body js/document))
(.-body js/document)))))
@GMMan
GMMan / S90overclock
Created January 25, 2021 20:25
Overclock script for Densha de Go! Plug & Play
#!/bin/sh -e
start() {
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
}
stop() {
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_boot_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_boot_freq" > "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API
#from http://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
@Speedy37
Speedy37 / gpg-agent-relay.sh
Created July 10, 2020 11:02
WSL2 gpg agent relay (Yubikey)
#!/bin/bash
# Launches socat+npiperelay to relay the gpg-agent socket file for use in WSL
# See https://justyn.io/blog/using-a-yubikey-for-gpg-in-windows-10-wsl-windows-subsystem-for-linux/ for details
GPGDIR="${HOME}/.gnupg"
USERNAME=Vincent
# I use the same username for wsl and windows, but feel free to modify the paths below if that isn't the case
WIN_GPGDIR="C:/Users/${USERNAME}/AppData/Roaming/gnupg"
NPIPERELAY="${HOME}/npiperelay.exe"
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2024 16:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@atoponce
atoponce / word-lists.md
Last active May 6, 2024 16:06
A list of notable and primarily English word lists that can be used for building passphrases.

Passphrase Word Lists

Introduction

This document outlines a number of different word lists for passphrase generation, encoding of binary data, and other uses. This document is grouped and sorted by the number of unique words in each word list, fewest unique words first.

Licensing Note

Some of these word lists are placed in the public domain, others are copyrighted with various licenses. Please refer to the license of each word

@pmac
pmac / ring-videos-download.py
Created October 30, 2018 00:16
Download all the videos between two events from Ring
# https://github.com/tchellomello/python-ring-doorbell
from ring_doorbell import Ring
# ID of the newest video you want
OLDER_THAN = 6589184120805222376
# ID of the oldest video you want
LAST_ONE = 6587337941997938664
# grab info on this many videos at a time
CHUNK_SIZE = 50