This file contains 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
#include "pt.h" | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
static int bid = 0; | |
double cost(int items, double price = 0.8); |
This file contains 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
# https://www.waveshare.com/wiki/PN532_NFC_HAT | |
# PN532 UART | |
import serial | |
import time | |
_port = '/dev/ttyUSB0' | |
_baudrate = 115200 | |
_timeout = 2 |
This file contains 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func timeroutTimer() { | |
fmt.Println("Waiting for timer") | |
c := time.After(10 * time.Second) |
This file contains 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func timeroutTimer() { | |
fmt.Println("Waiting for timer") | |
c := time.After(10 * time.Second) |
This file contains 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
# Ledou LED Light / Keelight | |
# Search gateway and lights and show sample colors | |
import socket | |
import time | |
import traceback | |
import sys | |
from itertools import cycle | |
import binascii | |
PORT = 41330 |
This file contains 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
# MIT License | |
# | |
# Copyright (c) 2020 cassc | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/animation.gsap.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdn.jsdelivr.net/npm/lax.js" ></script> | |
</head> | |
<body> | |
<div class="container"> |
This file contains 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
# Get event id and names for connected HID devices: | |
# cat /proc/bus/input/devices | grep -P '^[NH]: ' | paste - - | |
# | |
# To allow current user to run this script without root: | |
# sudo usermod -a -G input $USER | |
import evdev | |
from evdev import InputDevice, categorize # import * is evil :) | |
import time | |
import traceback | |
import sys |
This file contains 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
# FS005009 Formaldehyde (HCHO) sensor | |
# 0 1 2 3 4 5 6 7 8 | |
# 起始位 设备类型 单位 小数位数 气体浓度高位 气体浓度低位 满量程高位 满量程低位 校验值 | |
# ff 17 04 00 00 1b 07 d0 f3 | |
# | |
# 气体浓度值=气体浓度高位*256+气体浓度低位, 单位:mg/m3 | |
# Sample output: | |
# ff 17 04 00 00 1b 07 d0 f3 | |