- Raspberry PI Zero 2W (any PI should work ok)
- nodemcu-32s
- USB OTG Cable, Power Supply, etc...
- Flash the OS into the SD card (32gb is plenty) (Config: Username, Wifi and SSH)
- Connect the i2c RTC module to the rpi
#!/bin/bash | |
# Get the size of /snapshots | |
SNAPSHOT_SIZE=$(du -hs /snapshots 2>/dev/null | awk '{print $1}') | |
SNAPSHOT_TOTAL=$(ls | grep *.jpg | wc -l 2>/dev/null) | |
echo "[snapshots]" | |
echo "size: $SNAPSHOT_SIZE" | |
echo "total: $SNAPSHOT_TOTAL" | |
# Get the available space on the root partition |
// Ardiono Date https://adafruit.github.io/RTClib/html/class_date_time.html#a50502a3a29409c6c2507638779df1a9d | |
let now = new Date(); | |
// correct time zone offset for generating iso string | |
now.setMinutes(now.getMinutes() - now.getTimezoneOffset()) | |
console.log(now.toISOString()); |
export function getNodeVersion(): { major: number; minor: number; patch: number } { | |
const version = process.version.match(/(\d+)\.(\d+)\.(\d+)/); | |
const [major, minor, patch] = ensureArray(version) | |
.slice(1) | |
.map((match) => parseInt(match as string, 10)); | |
return { | |
major, | |
minor, | |
patch, | |
}; |
export default async function scheduler<T, K>( | |
maxconnections: number, | |
items: K[], | |
functor: (item: K) => Promise<T> | |
): Promise<Array<T | undefined>> { | |
const workers: Array<T | undefined> = []; | |
for await (const result of runTasks<T>(maxconnections, tasks(items, functor))) { | |
workers.push(result); | |
} | |
return workers; |
const playlistId = new RegExp(/(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{12,})[a-z0-9;:@#?&%=+\/\$_.-]*/) | |
const videoId = new RegExp(/(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@#?&%=+\/\$_.-]*/) | |
const getYouTubeId = (youTubeUrl: string): string | undefined => { | |
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ | |
var match = youTubeUrl.match(regExp) | |
if (match && match[2].length == 11) { | |
return match[2] | |
} | |
return undefined |
<head>
el siguiente script: <script src="https://cdn.jsdelivr.net/npm/esc-pos-encoder@1.3.0/dist/esc-pos-encoder.js"></script>
function ImprimeTicketConQR() {
const img = new Image();
const encoder = new EscPosEncoder();
return new Promise((resolve, reject) => {
img.src='./Factu Online_files/QR2300005.jpg';
img.onload = () => {
const result = encoder
import { isPlainObject } from '@salesforce/ts-types'; | |
/** | |
* Use mapKeys to convert object keys to another format using the specified conversion function. | |
* | |
* E.g., to deep convert all object keys to camelCase: mapKeys(myObj, _.camelCase, true) | |
* to shallow convert object keys to lower case: mapKeys(myObj, _.toLower) | |
* | |
* NOTE: This mutates the object passed in for conversion. | |
* |
yarn upgrade --latest