This file contains hidden or 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
| from dash import Dash, html, dcc, Input, Output, State | |
| import pandas as pd | |
| import plotly.express as px | |
| import random | |
| from datetime import date | |
| app = Dash( | |
| __name__, |
This file contains hidden or 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
| type ProductOptionSet = { | |
| id: string; | |
| name: string; | |
| is_optional: boolean; // 是否可选 | |
| default_product_id?: string; // 默认选项 | |
| products: { | |
| id: string; | |
| uuid: string; | |
| name: string; | |
| }[]; |
This file contains hidden or 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
| useradd ryanwang -m | |
| usermod -aG sudo,root ryanwang | |
| echo -e "123456\n123456" | passwd ryanwang | |
| mkdir -p /home/ryanwang/.ssh | |
| cat << EOF | tee /home/ryanwang/.ssh/authorized_keys | |
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC515Vj7NQeX1xOtcvoYJrwT7Df5s22u4kmnN1eiYNB60B5EJ8Nhn9TwBpRjVe8LTmzX6rZ91dGWxXHRjc2VVaNy5ibrkB4vF2CzuHGsyVkxtZY9zlwxxIutmjEavIV581VczehIKu+RmU0vut1/VgC0zwEQfRFH5iPSgAX9NhyB8CcRaTaGMRiw7NMqBJmGPYhyo4l+bN7VK/xt3o8a9nmwzxWBDKS/tO0V/+o8WL1NTlb/R2fBeu2oKLtaB2AaQplJdjsOLP1QI8UFIVRfwYvALiNToouT2vvZGCIumy9U5NmolRsqIdamkt+Wc6smj39o0zctaOtZ/eq/fand/f1 hwwangwang@gmail.com | |
| EOF | |
| chmod 600 /home/ryanwang/.ssh/authorized_keys | |
| chown ryanwang /home/ryanwang/.ssh/authorized_keys |
This file contains hidden or 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
| from arcservice.models import Project | |
| from arcservice.models.users.user_project import UserProject | |
| from arcservice.services.users import group_svc | |
| from arcservice.services.users.user_project_svc import get_recent_projects, add_user_to_project | |
| project_id = 128916363976894334 | |
| project = Project.get(project_id) | |
| def get_user_ids(group_id): |
This file contains hidden or 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
| # coding=utf-8 | |
| import os | |
| from fpdf import FPDF | |
| from PIL import Image | |
| class PDF(FPDF): | |
| pass | |
This file contains hidden or 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
| from wand.image import Image | |
| import io | |
| import PyPDF2 | |
| def pdf_page_to_png(src, pagenum=0, resolution=None): | |
| """ | |
| Returns specified PDF page as file object. | |
| :param str src: PDF from which to take pages. | |
| :param int pagenum: Page number to take. | |
| :param int resolution: Resolution for resulting png in DPI. | |
| """ |
This file contains hidden or 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
| <html> | |
| <head> | |
| <style> | |
| @page { | |
| margin: 5cm; | |
| @frame content_frame { /* Content Frame */ | |
| left: 50pt; | |
| right: 50pt; | |
| top: 50pt; | |
| height: 800pt; |
This file contains hidden or 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
| function timeout(t) { | |
| return new Promise(function(resolve) { | |
| setTimeout(() => { | |
| resolve(t) | |
| }, 1000) | |
| }) | |
| } | |
| function runner(genFactory) { | |
| const gen = genFactory() |
This file contains hidden or 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
| license: mit |
This file contains hidden or 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
| license: mit |