Skip to content

Instantly share code, notes, and snippets.

View iydon's full-sized avatar
📚
Focusing

Iydon Liang iydon

📚
Focusing
View GitHub Profile
@iydon
iydon / 404.html
Created June 4, 2019 07:37
网址缩短
<!-- This file should in `templates` directory -->
{% extends "base.html" %}
{% block title %}网址缩短 - Page Not Found{% endblock %}
{% block page_content %}
<div class="page-header">
<h1>Not Found</h1>
</div>
{% endblock %}
# -*- encode: utf-8 -*-
from itertools import product
from math import pi,e
from re import findall, sub
def find_formula(formula:str, constants:dict=dict(), methods:dict=dict(), eps:float=1e-2):
"""Example
>>> f = "[-9~9,bi]*pi+[0~10,bi]*e"
>>> bi = lambda i,j: range(i,j+1)
@iydon
iydon / netease_music.py
Created November 17, 2019 14:25
网易云歌词爬虫 (低效)
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
'''
@File : netease_music.py
@Time : 2019/11/13
@Author : Vian Lee
@Contact : <no contact>
@Docstring : <no docstring>
'''
@iydon
iydon / buymeacoffee.html
Created December 25, 2019 00:14
Buy me a coffee
<style>.bmc-button img{width: 35px !important;margin-bottom: 1px !important;box-shadow: none !important;border: none !important;vertical-align: middle !important;}.bmc-button{padding: 7px 10px 7px 10px !important;line-height: 35px !important;height:51px !important;min-width:217px !important;text-decoration: none !important;display:inline-flex !important;color:#FFFFFF !important;background-color:#FF813F !important;border-radius: 5px !important;border: 1px solid transparent !important;padding: 7px 10px 7px 10px !important;font-size: 28px !important;letter-spacing:0.6px !important;box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;margin: 0 auto !important;font-family:'Cookie', cursive !important;-webkit-box-sizing: border-box !important;box-sizing: border-box !important;-o-transition: 0.3s all linear !important;-webkit-transition: 0.3s all linear !important;-moz-transition: 0.3s all linear !important;-ms-transition: 0.3s all linear
\documentclass[11pt]{letter}
% Packages
\input{preamble.tex}
% Information
\Who{Dr. Niko Bellic}
\Title{, PhD}
\authordetails{
Department of Mathematics \\ % your department
123 Broadway \\ % Your address
Berkeley CA 12345 \\ % Your city, zip code, country, etc
@iydon
iydon / mitmdump_download.py
Last active January 29, 2020 07:23
配合 mitmproxy 工具使用下载 APP 数据
# mitmdump -s __file__ -p 8888
from mitmproxy import http
idx = 1
def request(flow):
pass
def response(flow):
@iydon
iydon / bilibili-search.py
Created January 29, 2020 07:13
Bilibili 搜索
import collections
import json
import re
import requests
import tqdm
from bs4 import BeautifulSoup
def bilibili_search(keyword, pages=[1], order='', duration=0, typeid=0, headers=dict()):
'''Bilibili 综合搜索
@iydon
iydon / recorder.py
Last active September 29, 2022 03:21
A recorder for keyboard and mouse events.
import fire
import time
class Recorder:
'''A recorder for keyboard and mouse events.
'''
def __init__(self, log_name='record.log', keyboard=True, mouse=True, speed=1):
self._log_name = log_name
self._keyboard = keyboard
@iydon
iydon / 期末考试方案修改意见及矛盾总结.md
Last active May 14, 2020 02:01
2019-2020 学年春季学期期末考试方案修改意见及矛盾总结

前言

  • 简要介绍:因为疫情影响,2019-2020 学年春季学期期末考试方案在学期末发布,且在未征求老师及学生意见的情况下有重大改变,因此很多学生和老师都对此有很大意见,并专门建立了 QQ 群讨论。本文由众多本科生于在线文档上共同协作,较全面地总结了大家提出来的意见和建议。
  • 核心问题:考核方式(是否记录 GPA)以及考核时间。

定义规范

在讨论时,大家理解的定义不同,产生的结论也不尽相同,因此将定义进行规范化,避免无意义的争执。

  • 所有的课程都是有考核的,分别是“考查”(为避免同音歧义,不设置“考察”的定义)和“考试”,教务系统的执行计划中的分类无法得出共有属性,因此重新定义这两个概念,以是否有必须线下监考的考试或者必须线下进行的活动为区分点(考查没有,考试有),以考查为考核方式的课程线下与线上差别不大,因此不应过多干预,我们关心的应该是以考试为考核方式的课程的策略指定。
  • 成绩记录方式有两种,不计入 GPA 的是二级制(P/F 制),记入 GPA 的是十三级制。
  • 无W退课:因为疫情原因新设置的临时制度,即退课之后成绩单上没有 W。
@iydon
iydon / 404.py
Created May 24, 2020 18:56
随机404网址生成
import requests
from faker import Faker
from random import randint
from rstr import xeger
F = Faker()