Skip to content

Instantly share code, notes, and snippets.

View tianrking's full-sized avatar
🌴
On vacation

tianrking

🌴
On vacation
View GitHub Profile
#!/bin/bash
export LANG=en_US.UTF-8
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
PLAIN="\033[0m"
red(){
@tianrking
tianrking / Display map Pyside6& AMAP
Created August 7, 2023 09:23
Display map Pyside6& AMAP
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtWebEngineWidgets import QWebEngineView
class WebMap(QWebEngineView):
def __init__(self):
super().__init__()
self.setHtml(f'''
@tianrking
tianrking / Pyqtgraph & Pyside6
Last active August 7, 2023 09:01
Pyqtgraph & Pyside6
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QLabel, QPushButton
from PySide6.QtCore import QThread, Signal
import pyqtgraph as pg
import numpy as np
import random
import time
class SerialThread(QThread):
data1_received = Signal(float)
@tianrking
tianrking / Pyside6 & matplotlib
Last active August 7, 2023 07:08
Pyside6 & matplotlib
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QLabel
from PySide6.QtCore import QThread, Signal
import serial
import numpy as np
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import random
import time
@tianrking
tianrking / G.py
Created October 26, 2022 08:22
XIAO SAMD micropython demo
from machine import Pin, Timer
#PIN
#GPIOPA10 XIAOSAMD2
#GPIOPA09 XIAOSAMD5
#GPIOPA08 XIAOSAMD4
#GPIOPA07 XIAOSAMD8
#GPIOPA06 XIAOSAMD10
#GPIOPA05 XIAOSAMD9
#GPIOPA4 XIAOSAMD1 PA04 / A1/D1
#include <TFT_eSPI.h>
#include "Free_Fonts.h"
TFT_eSPI tft;
TFT_eSprite spr = TFT_eSprite(&tft);
#define SCREEN_WIDTH 320 // Wio Terminal Maximum Width
#define SCREEN_HIGH 240 // Wio Terminal Maximum Height
#define PIXEL 4 // Width of one letter
const static unsigned int FONT_ROW_HEIGHT = 22; // The height of a letter
@tianrking
tianrking / panels
Created October 9, 2022 02:26
树莓派 任务栏 缺失 ~/.config/lxpanel/LXDE-pi/panels curl -O
# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.
Global {
edge=top
allign=left
margin=0
widthtype=percent
width=100
height=36
@tianrking
tianrking / gist:af0ba92a27752c3e98cc22327976b881
Last active September 15, 2022 06:38
王天睿 实习 笔试题 行云智能

01

class ListNode:
   def __init__(self, id, name  ,father = None):
      self.id = id
      self.father = father
      self.name = name

class Solution(object):
### Keybase proof
I hereby claim:
* I am tianrking on github.
* I am tianrking (https://keybase.io/tianrking) on keybase.
* I have a public key whose fingerprint is 6E4A A8FB 0AB2 BD5D D601 FB2D 1E76 9180 CD44 A3C4
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am tianrking on github.
  • I am tianrking (https://keybase.io/tianrking) on keybase.
  • I have a public key whose fingerprint is 9588 81BB 1A1E ECA5 EA7D 5964 1D8C 2FB8 796A B3E2

To claim this, I am signing this object: