Skip to content

Instantly share code, notes, and snippets.

@tomwagner
tomwagner / standby.py
Created February 12, 2024 07:42
Vero V disable blue led diode in standby mode (place it in /home/osmc/.kodi/userdata/standby.py)
import os
os.system('/bin/bash -c "echo "0" | sudo tee /sys/class/leds/standby/brightness"')
@tomwagner
tomwagner / chrome-kiosk-setup-pi.sh
Last active November 26, 2021 13:57 — forked from KyleBruene/chrome-kiosk-setup.sh
Chrome Kiosk Setup
#!/bin/bash
if [ $# -ne 0 ]; then
echo "USAGE: mkkiosk.sh"
echo "Create new user 'kiosk' and configure LightDM to auto-login this user to a X session running only Chrome"
echo "in --kiosk mode."
exit 1
fi
set -x; set -e
date
@tomwagner
tomwagner / machine.js
Last active May 2, 2021 19:51
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine(
{
id: 'cardShuffle',
initial: 'init',
context: {
index: 0,
activeCard: null,
round: 0,
knownCards: ['kid1', 'kid2', 'kid3', 'kid4'], // random
unknownCards: ['uid1', 'uid2', 'uid3', 'uid4'],
@tomwagner
tomwagner / machine.js
Last active May 2, 2021 16:41
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'cardShuffle',
initial: 'init',
context: {
index: 0,
activeCard: null,
isFirstRound: true,
knownCards: ["id5", "id6"], // random
unknownCards: ["id1", "id2", "id3", "id4"]
@tomwagner
tomwagner / a-mongodb-replica-set-docker-compose-readme.md
Created December 6, 2020 07:54 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

@tomwagner
tomwagner / machine.js
Last active November 19, 2020 10:47
Generated by XState Viz: https://xstate.js.org/viz
const pedestrianStates = {
initial: 'logged',
states: {
walk: {
on: {
PED_TIMER: 'wait'
}
},
wait: {
on: {
const x = ['test', 'test2', 'test3']
<CmxSelect
id="role"
required
label="Role"
placeholder="Select role2"
onChange={(e: any) => console.log('select, onChange')}
>
{x.map((role, i) => (
<CmxSelectOption key={`role-${role}`} value={i}>
# https://github.com/wsargent/docker-cheat-sheet
version: '3.1'
services:
road-scan-server:
image: registry.gitlab.com/exactdev/road-scan-app/server:latest
restart: always
ports:
- "3501:3501"
# https://github.com/wsargent/docker-cheat-sheet
version: '3.1'
services:
road-scan-client:
image: registry.gitlab.com/exactdev/road-scan-app/client:latest
restart: always
ports:
- "3000:3000"
import * as classNames from 'classnames';
import * as React from 'react';
import Select from 'react-select';
// import '../../../../scss/form/v1/select/cmx-select.component.scss';
// import { Input as SelectInput } from 'react-select/lib/components/Input';
import { InputProps } from '../types/InputProps';
export interface Option {
label: string;
value: string;