This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob from "glob"; | |
import { promises as fs } from "fs"; | |
let changed = false; | |
Promise.all( | |
glob.sync("./**/*.rst").map((s) => | |
fs.readFile(s, "utf-8").then((rst) => { | |
const lines = rst.split("\n"); | |
lines.forEach((line, n) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"job": { | |
"id": "5c5f3ef3-2bf4-4017-80ef-ff84dab19a3b", | |
"document": { | |
"fw": "https://github.com/bifravst/firmware/releases/download/v3.0.0/cat-tracker-Thingy91-ltem-debug-v3.0.0.hex" | |
}, | |
"status": { | |
"status": "SUCCEEDED", | |
"statusDetails": { | |
"status": "success" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dirs = ["UP", "DOWN", "LEFT", "RIGHT"]; | |
const max = 20; | |
const interval = 2500; | |
let i = 0; | |
console.time("heads"); | |
const r = setInterval(() => { | |
const n = Math.floor(Math.random() * dirs.length); | |
console.timeLog("heads", ++i, dirs[n]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const threshold = 26.5; | |
const interval = 10; | |
let currentTemp; | |
let isOff; | |
function setLEDS(l1,l2,l3) { | |
digitalWrite(LED1, l1); | |
digitalWrite(LED2, l2); | |
digitalWrite(LED3, l3); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dht = require("DHT22").connect(A1); | |
const threshold = 25; | |
const interval = 10; | |
let currentTemp = 0; | |
// LEDs off | |
LED1.write(false); | |
LED2.write(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(-inkscape|font|word|text|letter|writing)-[^:]+:[^;]+; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -y -i $1 -vf palettegen palette.png | |
ffmpeg -y -i $1 -i palette.png -filter_complex paletteuse -r 10 $1.gif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AWS from 'aws-sdk' | |
const db = new AWS.DynamoDB(); | |
const oldTable = 'bifravst-cellGeolocationdeviceCellGeoLocations9F25FBED-1VK9FPSS5GX3G' | |
const newTable = 'bifravst-cellGeolocationdeviceCellGeoLocation757F8D27-1K6Z9IBMWMV2K' | |
const refill = (ExclusiveStartKey) => db.scan({ | |
TableName: oldTable, | |
Limit: 100, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"cellID": 1805149, | |
"mccmnc": 24412, | |
"areaCode": 50222, | |
"locations": [ | |
{ | |
"date": "2020-02-26T06:08:32.914Z", | |
"lat": 61.49116083333333, | |
"lng": 23.771811333333332, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import * as querystring from 'querystring' | |
const f = (pageNextToken, messages = []) => fetch(`https://api.nrfcloud.com/v1/messages?${querystring.stringify({ | |
inclusiveStart: '2019-01-01T00:00:00Z', | |
exclusiveEnd: new Date().toISOString(), | |
pageSort: 'desc', | |
pageLimit: 100, | |
...(pageNextToken ? { pageNextToken } : {}), | |
})}`, { |