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 / test.ruby
Created June 13, 2020 10:04
ruby call/cc demo
require 'continuation'
def strange
callcc { |cont| return cont }
print "Back in method, "
end
print "Before method. "
c = strange()
print "After method. "
c.call if c
from mitmproxy import ctx
class Replacer:
def __init__(self):
self.num = 0
def response(self, flow):
self.num = self.num + 1
flow.response.content = flow.response.content.replace('知道'.encode(), '知道个屁'.encode())
import json
from mitmproxy import ctx
from mitmproxy import command
class Analysis:
def __init__(self):
self.info = {}
@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,
}
)
from manimlib.imports import *
class Main(Scene):
def construct(self):
dot = Dot()
line = Line()
arrow = Arrow()
circle = Circle()
annulus = Annulus()
from manimlib.imports import *
class Stop(Exception):
def __init__(self, last_animations):
self.animations = last_animations
class Main(Scene):
current_month = 1
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']
@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",
@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 / 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:/=\%%"