Working to sniff Bluetooth Low Energy with the adafruit sniffer
For more information, see this blog post
Going the python route, as described here
before installing pySerial, did ...
Working to sniff Bluetooth Low Energy with the adafruit sniffer
For more information, see this blog post
Going the python route, as described here
before installing pySerial, did ...
| // based on: https://stackoverflow.com/a/67136959 | |
| const niceRounder = (number) => { | |
| let near = 1 | |
| if (number > 100) near = 10 | |
| if (number > 1000) near = 100 | |
| if (number > 10000) near = 1000 | |
| if (number % near === 0) return number; |
| # example: get rid of large `.tif` and `.nc` files in gis/tmp | |
| # from https://www.geeksforgeeks.org/how-to-remove-a-large-file-from-commit-history-in-git/ | |
| git filter-branch --force --index-filter \ | |
| 'git rm --cached --ignore-unmatch gis/tmp/*.tif' \ | |
| --prune-empty --tag-name-filter cat -- --all | |
| git filter-branch --force --index-filter \ | |
| 'git rm --cached --ignore-unmatch gis/tmp/*.nc' \ | |
| --prune-empty --tag-name-filter cat -- --all |
| // npm install mapshaper --save | |
| import mapshaper from 'mapshaper' | |
| // Example of runCommands: converting a directory of Shapefiles to GeoJSON | |
| mapshaper.runCommands('-i shapefiles/*.shp -o geojson/ format=geojson'); | |
| // ---- | |
| // Example of applyCommands: processing a json array |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "s3:ListAllMyBuckets" | |
| ], | |
| "Resource": "arn:aws:s3:::*" | |
| }, |
| const fs = require('fs') | |
| const gm = require('gm').subClass({ imageMagick: '7+' }); | |
| WIDTH = 1138 | |
| HEIGHT = 50 | |
| X = 0 | |
| Y = 0 | |
| gm('./images/us_at_bottom.png') | |
| .region(WIDTH, HEIGHT, X, Y) |
| [ | |
| { | |
| "AllowedHeaders": [ | |
| "*" | |
| ], | |
| "AllowedMethods": [ | |
| "GET", | |
| "HEAD" | |
| ], | |
| "AllowedOrigins": [ |
| // from https://github.com/iamkun/dayjs/issues/1619#issuecomment-1185714859 | |
| const round: PluginFunc = (option, dayjsClass) => { | |
| dayjsClass.prototype.round = function (amount, unit) { | |
| const mod = this.get(unit as UnitType) % amount; | |
| if(mod < amount / 2) { | |
| return this.subtract(mod, unit).startOf(unit); | |
| } |
| // installation: | |
| // npm install dayjs dayjs-plugin-utc --save | |
| // note: if not already a module, in package.json add "type":"module", | |
| import dayjs from 'dayjs'; | |
| import updateLocale from 'dayjs/plugin/updateLocale.js'; | |
| import utc from 'dayjs/plugin/utc.js'; | |
| import timezone from 'dayjs/plugin/timezone.js'; | |
| // set up the as-of date |
| const time_hash = Date.now().toString(36); | |
| // reverse it for more wordiness: | |
| const time_hash2 = Date.now().toString(36).split("").reverse().join("") |