Skip to content

Instantly share code, notes, and snippets.

View asukaminato0721's full-sized avatar
💭
I may be slow to respond.

Asuka Minato asukaminato0721

💭
I may be slow to respond.
View GitHub Profile
@asukaminato0721
asukaminato0721 / life_is_short.py
Created January 19, 2022 17:59
A script to remind how time flies.
#!/usr/bin/env python3
from calendar import isleap
from datetime import datetime
from subprocess import Popen
NOW = datetime.now()
YEAR = NOW.year
FIRST_DAY = datetime(YEAR, 1, 1)
DAY_DIFF = (NOW - FIRST_DAY).days + 1
DAY_COUNT = 366 if isleap(YEAR) else 365
@asukaminato0721
asukaminato0721 / cookies.json
Created January 15, 2022 06:24
QuillBot premium for free. Open Quillbot website Delete cookies Copy Quillbot cookies from the link given below Paste cookies and click on import button. Now here is the tricky part: When you import cookies then refresh your browser. After 3 seconds, you will see “PREMIUM” something similar to below picture When “PREMIUM” appears then suddenly p…
[
{
"domain": ".quillbot.com",
"expirationDate": 1673083346,
"hostOnly": false,
"httpOnly": false,
"name": "_uetvid",
"path": "/",
"sameSite": null,
"secure": false,
@asukaminato0721
asukaminato0721 / galgame_in_wine.md
Last active February 18, 2022 16:16
Notes on play Galgame on wine 笔记: 如何在 wine 上打 Galgame
  1. choose good tools.
    1. crossover 关于无限 15 天试用期, 把容器里的 .eval 文件删除就重新计时了.
    2. playonlinux
    3. winetricks
    4. bare wine
  2. 函数库
    1. 原装先于内建
      1. d3dx11_43
      2. d3x9_43
  3. dsound
@asukaminato0721
asukaminato0721 / Thread-end.py
Last active January 8, 2022 20:54
Clojure's -> and ->> operator in python
"""
This mimic the behavior of clojure's Thread-end ->>
"""
from functools import reduce, wraps
from typing import Callable
def double_rightarrow_decorator(f: Callable):
@asukaminato0721
asukaminato0721 / int.py
Created January 8, 2022 20:02
WIP. a wrapper about integrate.
"""
usage: python3 this_file.py expr
for example:
python3 this_file.py "tan(x)"
python3 this_file.py "^(x,-1)"
python3 this_file.py "+(x,-1)"
python3 this_file.py "+(-1,x,^(x,-1))"
"""
import json
@asukaminato0721
asukaminato0721 / implicit function common tangent.wls
Created January 4, 2022 08:12
Mathematica draw implicit function common tangent
(*
written in 2018/8/29
*)
Clear["Global`*"];
(*f[x,y]=0,(x1,y1),g[x,y]=0,(x2,y2) 本代码略去了两条曲线正好相切于同一点处的切线*)
f[x_, y_] = (x)^2 + x y + y^2 - 1;
g[x_, y_] = (x - 4)^2 + x y + (y)^2 - 1;(*两个隐函数*)
@asukaminato0721
asukaminato0721 / simple_curry.py
Created January 1, 2022 12:32
make map and filter easy to use.
from functools import wraps
from typing import Callable
def wrapper(f: Callable):
@wraps(f)
def inner(*args):
if len(args) == 1 and isinstance(args[0], Callable):
def curry(x):
lei[n_Integer] :=
Range[0, n] //
1 + 2 # & //
Partition[#, 2] & //
Map[1./Times @@ # &] //
Total //
#*8 &;
lei[10000]
lei2[n_Integer] := MapThread[#2 *1./#1 &, {
from enum import Enum, auto
from typing import Any, Callable
class msg(Enum):
FIRST = auto()
SECOND = auto()
def cons(x: Any, y: Any):
@asukaminato0721
asukaminato0721 / douban_crawel.py
Last active December 31, 2021 20:31
script to fetch douban top250 & imdb250
from typing import List
import requests
from lxml.etree import HTML
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0",
}
params = (