Skip to content

Instantly share code, notes, and snippets.

View lovemyliwu's full-sized avatar
😍
feel free

Smite Chow lovemyliwu

😍
feel free
View GitHub Profile
@lovemyliwu
lovemyliwu / shapely_linestring_cases.md
Last active December 29, 2023 09:14
shapely 线段操作
  1. 平移
>>> line=shapely.LineString([(0,0.3), (0.3,0)])
>>> line.parallel_offset(0.13, side="right")
<LINESTRING (0.092 0.392, 0.392 0.092)>
  1. 计算弧度radian,角度angle
origin=(0,0)
@lovemyliwu
lovemyliwu / do.md
Created November 4, 2023 08:25
change resolution for centos 7 on hyper-v

hyper-v

via: LIS/lis-next#318

Set-VMVideo -VMName centos -HorizontalResolution 2560 -VerticalResolution 1440 -ResolutionType Single
Get-VMVideo centos

centos 7

@lovemyliwu
lovemyliwu / command
Created November 3, 2023 03:02
how to use custom url protocol to open folder on windows
cmd /C "call set arg=%1% &&call set uri=%%arg:explorer://=%% && call echo %%uri%% && call C:\Windows\explorer.exe %%uri:/=\%%"
@lovemyliwu
lovemyliwu / fix.md
Last active August 3, 2023 11:47
stackedit collaps support details tag

use custom template

{{{files.0.content.html}}}
<script>
document.querySelectorAll('.step-details').forEach(item=>{
item.outerHTML=`<details>${item.innerHTML}</details>`
})
document.querySelectorAll('.step-summary').forEach(item=>{
item.outerHTML=`${item.innerHTML}`
@lovemyliwu
lovemyliwu / cli.py
Last active October 22, 2022 09:26
python connect smb server through windows domain user
import sys
from optparse import OptionParser
from smb.SMBConnection import SMBConnection
def main(argv):
parser = OptionParser()
parser.add_option("-u", "--username",
help="windows username that will be used for authentication")
parser.add_option("-p", "--password",
import binascii
file = open('douyin_signature.csv', 'wb')
bom = binascii.unhexlify(''.join("EF BB BF".split()))
file.write(bom)
file.write('unique_id,signature'.encode())
def get_signature(unique_id):
import requests
response = requests.get(f'https://www.iesdouyin.com/web/api/v2/user/info/?unique_id={unique_id}').json()
return response['user_info']['signature']
from manimlib.imports import *
class Stop(Exception):
def __init__(self, last_animations):
self.animations = last_animations
class Main(Scene):
current_month = 1
from manimlib.imports import *
class Main(Scene):
def construct(self):
dot = Dot()
line = Line()
arrow = Arrow()
circle = Circle()
annulus = Annulus()
@lovemyliwu
lovemyliwu / demo.py
Created November 8, 2020 06:14
manim hello world
from manimlib.imports import *
class HelloWorld(Scene):
def construct(self):
hello_text = TextMobject(
"Hello World, from smite",
tex_to_color_map={
"World": YELLOW,
}
)
import json
from mitmproxy import ctx
from mitmproxy import command
class Analysis:
def __init__(self):
self.info = {}