Skip to content

Instantly share code, notes, and snippets.

@ariccio
ariccio / BluetoothConstants.ts
Created January 10, 2022 18:59
GATT services and characteristics
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue.
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800.
// This is a hack to make things easy.
['1800', "generic_access"],
['1801', "generic_attribute"],
['1802', "immediate_alert"],
['1803', "link_loss"],
@sirikon
sirikon / task.py
Last active July 25, 2023 12:09
Task file in Python 3
#!/usr/bin/env python3
def cli():
@command
def hello(*args):
cmd('echo', 'Hello', *args)
@roberthoenig
roberthoenig / lisparser.py
Created August 26, 2017 19:48
Simple Lisp parser for Python 3.
import sys
from typing import Any, List
# Parse input string into a list of all parentheses and atoms (int or str),
# exclude whitespaces.
def normalize_str(string: str) -> List[str]:
str_norm = []
last_c = None
for c in string:
@sloanlance
sloanlance / Python utilities.md
Created June 28, 2017 15:30
Python: A document of ready to use utilities included in Python's standard modules

Python's Built-in Utilities

List of command line accessible tools built into the Python standard library.

Encoding and decoding

Base64 en/decoding:

python -m base64 -d [file]

python -m base64 -e [file]

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active October 24, 2024 17:43
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@endolith
endolith / LICENSE.txt
Last active September 19, 2024 10:24
Python implementation of "Cookbook formulae for audio EQ biquad filter coefficients"
MIT License
Copyright (c) 2019 endolith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#-*- coding: utf8 -*-
# implementation of recipe on: http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
import numpy as n, pylab as p
# variaveis de parametrizacao
fa=44100.
f=2.
# tipos: LPF, HPF, BPF, BPF2, notch
# APF, peakingEQ, lowShelf, highShelf
@oneamtu
oneamtu / gtest.cmake
Created September 16, 2012 20:38
How to add google test as an downloadable external project
########################### GTEST
# Enable ExternalProject CMake module
INCLUDE(ExternalProject)
# Set default ExternalProject root directory
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/third_party)
# Add gtest
# http://stackoverflow.com/questions/9689183/cmake-googletest
ExternalProject_Add(
@eliotb
eliotb / aisgen.py
Last active October 26, 2022 16:35
Tools for working with Texas Instruments COFF and AIS files
#!/usr/bin/env python
'''Read fully linked TI COFF file, and generate AIS format file
Commandline parameters
enable sequential read,
pll and emifb configuration
pinmux configuration
enable checksums
'Eliot Blennerhassett' <eblennerhassett@audioscience.com>