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 / macOS.html
Last active April 1, 2023 18:37
Fake Windows and macOS Update Screens
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: #000 no-repeat center center fixed;
margin: 0;
cursor: none;
}
@iydon
iydon / test_asterisk_and_ampersand.cpp
Last active September 24, 2020 02:26
C++ 中 * 和 & 的个人习惯尝试(不喜欢过于简洁的符号来表示内容,容易产生歧义)
#include <iostream>
#define pointer(x) *x
#define address(x) &x
#define refer(x) &x
using namespace std;
void swap(int refer(x), int refer(y)) {
@iydon
iydon / tinypng.py
Created July 12, 2020 21:37
TinyPNG – Compress PNG images while preserving transparency
import os
import pathlib
import shutil
import subprocess
import tempfile
import warnings
def tinypng(input_path, output_path):
'''TinyPNG – Compress PNG images while preserving transparency
@iydon
iydon / app.py
Created July 9, 2020 14:24
MD5 存储服务
sqlite_path = 'data.sqlite'
import os
from datetime import datetime, date, time
from time import localtime, time as now
from sqlalchemy import Column, Integer, String, Date, Time, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
import copy
class S2F:
def __init__(self, name='_'):
self._name = name
def __call__(self, args, body):
_ = locals()
exec('def {}({}):\n\t{}'.format(self._name, args, body.replace('\n', '\n\t')))
@iydon
iydon / main.js
Created June 10, 2020 21:23
哔哩哔哩自动点赞收藏
var favorite_title = '三连用收藏夹-1';
var interval = 30; // second
var delay = 2; // second
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
setInterval(() => {
@iydon
iydon / main.srt
Last active May 27, 2020 18:53
【程序】多语言来回翻译《让子弹飞》片段
1
00:00:35,233 --> 00:00:37,028
自宣统皇帝退位以后
2
00:00:38,067 --> 00:00:40,294
鹅城一共来过51任县长
3
00:00:40,499 --> 00:00:44,795
@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()
@iydon
iydon / 期末考试方案修改意见及矛盾总结.md
Last active May 14, 2020 02:01
2019-2020 学年春季学期期末考试方案修改意见及矛盾总结

前言

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

定义规范

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

  • 所有的课程都是有考核的,分别是“考查”(为避免同音歧义,不设置“考察”的定义)和“考试”,教务系统的执行计划中的分类无法得出共有属性,因此重新定义这两个概念,以是否有必须线下监考的考试或者必须线下进行的活动为区分点(考查没有,考试有),以考查为考核方式的课程线下与线上差别不大,因此不应过多干预,我们关心的应该是以考试为考核方式的课程的策略指定。
  • 成绩记录方式有两种,不计入 GPA 的是二级制(P/F 制),记入 GPA 的是十三级制。
  • 无W退课:因为疫情原因新设置的临时制度,即退课之后成绩单上没有 W。
@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