Given a binary at cmd/server/main.go, create a binary at bin/server that is built for a Raspberry Pi:
env GOOS=linux GOARCH=arm GOARM=5 go build -o ./bin/server ./cmd/server/main.go| await run(); | |
| async function run() { | |
| let loop = 0; | |
| while (true) { | |
| loop++; | |
| console.log("loop:", loop); | |
| const items = get_items(); | |
| if (!items.length) break; |
| <script lang="ts"> | |
| export let label: string | |
| export let type: string = "text" | |
| export let value: string = "" | |
| export let disabled: boolean = false | |
| export let validate: (val: string) => boolean | |
| export let valid: boolean = false | |
| let id = `field-${Math.floor(Math.random() * 1000)}` |
| // Lots of examples here: | |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array | |
| const arr = [ 1, 2, 3 ] | |
| // first item in array: | |
| arr[0] | |
| // last item: | |
| arr[2] |
| SUBSYSTEM=="input", GROUP="input", MODE="0666" | |
| SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE:="666", GROUP="plugdev" | |
| KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE="0666", GROUP="plugdev" |
| /** | |
| * Control a USB relay board using USB. | |
| * | |
| * This code helped a lot in the understanding of what they boards | |
| * expect for hex inputs: | |
| * https://github.com/jaketeater/Very-Simple-USB-Relay/blob/master/relay.py | |
| */ | |
| const HID = require('node-hid') | |
| const ALL_ON = 0xfe |
| /** | |
| * Control a USB relay board using USB. | |
| * | |
| * This code helped a lot in the understanding of what they boards | |
| * expect for hex inputs: | |
| * https://github.com/jaketeater/Very-Simple-USB-Relay/blob/master/relay.py | |
| */ | |
| const HID = require('node-hid') | |
| const ON = 0xfe |
| import React, { Component } from "react"; | |
| import logo from "./logo.svg"; | |
| import "./App.css"; | |
| import { BrowserRouter as Router, Route, Link } from "react-router-dom"; | |
| const COMPANIES = [ | |
| { | |
| id: 1, | |
| name: "Foo", | |
| accounts: [{ id: 4, name: "SubAccount", accounts: [] }] |