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
import json | |
from serial.tools.list_ports import comports | |
class SerialTools: | |
def __init__(self): | |
self.info = [] | |
def info(self): |
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
int LEDPin = 13; | |
int waitTimeOn = 10; | |
int waitTimeOff = 90; | |
void setup() { | |
pinMode(LEDPin, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(LEDPin, HIGH); |
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
int incomingByte = 0; // for incoming serial data | |
void setup() { | |
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps | |
} | |
void loop() { | |
// send data only when you receive data: | |
if (Serial.available() > 0) { |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
class MyList(list): | |
def __init__(self, *args): | |
super(MyList, self).__init__(args) | |
def __sub__(self, other): | |
return self.__class__(*[item for item in self if item not in other]) |
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
#!/usr/bin/python 3 | |
# -*- coding: utf-8 -*- | |
""" | |
`Device` is a tool class to operate serial ports. | |
""" | |
import json | |
import logging | |
import time | |
from typing import List, Dict, Tuple |
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
@echo off | |
set "cd_=%cd%" | |
:loop | |
set "cd_=%cd_:*\=%" | |
set "cd_tmp=%cd_:\=%" | |
if not "%cd_tmp%"=="%cd_%" goto loop | |
echo "cd_" |
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
server { | |
listen 80; | |
server_name www.jasonyang.xin jasonyang.xin; | |
return 301 https://www.jasonyang.xin$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name www.jasonyang.xin jasonyang.xin; | |
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
server { | |
listen 80; | |
server_name www.jasonyang.xin jasonyang.xin; | |
return 301 https://www.jasonyang.xin$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name www.jasonyang.xin jasonyang.xin; | |
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
server { | |
listen 80; | |
server_name *.frp.jasonyang.xin; | |
location / { | |
resolver 114.114.114.114 8.8.8.8; | |
proxy_pass $scheme://$host:7000; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
OlderNewer