Skip to content

Instantly share code, notes, and snippets.

View bendtherules's full-sized avatar
💭
Loving Typescript ...

Abhas Bhattacharya bendtherules

💭
Loving Typescript ...
View GitHub Profile
@bendtherules
bendtherules / spec-not-found-sections.json
Last active June 30, 2020 14:13
Section ids used in engine262 which are now invalid
[
"sec-numeric-types-bigint-unsighedRightShift",
"sec-allocatedtypedarray",
"sec-typedarray-species-create",
"sec-running-execution-context",
"sec-evaluate-expression-key-property-access",
"sec-evaluate-identifier-key-property-access"
]
@bendtherules
bendtherules / install_c_for_python_compilation.txt
Last active September 16, 2020 20:01
How to install C compiler for python ( compile c+python modules from pip and also from cython)
install Microsoft Visual C++ Compiler for Python 2.7
create this fake folder "C:\Users\ab\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\fake1\fake2"
set env var VS90COMNTOOLS= that fake folder
now goto C:\Users\ab\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0
youll find there is vcvarsall.bat, but it is not searched for here
copy it and paste in the VC folder
open for editing:
[in 3 places youll find this type of statement, replace them with these]
set VCINSTALLDIR=%~dp0
@bendtherules
bendtherules / example.js
Created November 14, 2020 07:26
property-reference-readspecwithus- example
obj = {
a: 123,
get ab() {return 456},
get abc() {return this.a},
}
obj.a
obj["a"+"b"]
@bendtherules
bendtherules / parseBluetoothDMM.js
Created July 13, 2023 09:54
Parse Bluetooth DMM Multimeter string (Baba AD-900)
// Reference - https://github.com/ludwich66/Bluetooth-DMM/wiki/Protocol-all-Variants
// From my multimeter - Baba AD-900 (Generic name - ZOYI ZT-300AB)
// rawString = '1B-84-70-A1-49-DA-B8-7B-66-DA-3A' // few mv //mv enabled both mV and V flag
rawString = '1B-84-70-D1-3D-2B-75-7F-66-FA-3A'; // 3.764 V // enabled V flag
function zeroPad(num, places) {
return String(num).padStart(places, '0');
}
@bendtherules
bendtherules / GFit-treadmill-BLE-Protocol.md
Last active July 23, 2023 06:00
Control GFit Treadmills with BLE protocol - read and write

Gfit treadmill BLE protocol

What is this?

GFit by FutureGo is an android/ios app to read and control supported BLE treadmills - usually made in China but white-labelled and sold under different names. This is an effort to document the Bluetooth protocol for it, only for personal use.

Sold under brands - Fitkit, Cultsport, Voit.

Not in scope - Elliptical treadmill, Rowers (also supported by Gfit app, but not documented here)

@bendtherules
bendtherules / Lenovo-HS11-Smart-Scale-BLE-protocol.md
Last active July 31, 2023 15:16
Lenovo HS11 Smart Scale BLE protocol (Chipsea CST34M97 chip)

Lenovo HS11 Scale picture

This is bluetooth (BLE) Gatt protocol for Lenovo HS11 Smart weight scale. It uses Chipsea CST34M97 chip, similar to some Huawei scales.

Main service = 0000fff0-0000-1000-8000-00805f9b34fb
Send command Characteristic = 0000fff1-0000-1000-8000-00805f9b34fb
Receive data Characteristic = 0000fff4-0000-1000-8000-00805f9b34fb

To read last N weight measurements