This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react'; | |
import useSWR from 'swr'; | |
const fetchMoreData = async (count: number) => { | |
await new Promise((resolve) => setTimeout(resolve, count * 100)); | |
return count | |
} | |
export default function Demo() { | |
const [count, setCount] = useState(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomList(list): | |
def __getattribute__(self, item): | |
methods = ['append', 'clear', 'copy', 'extend', 'insert', 'pop', 'remove'] | |
if item not in methods: | |
return super(CustomList, self).__getattribute__(item) | |
method = super(CustomList, self).__getattribute__(item) | |
def length_change(*args, **kwargs): | |
data = method(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
测试COS域名 | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 10 100 10 0 0 84 0 --:--:-- --:--:-- --:--:-- 85 | |
HTTP/1.1 200 OK | |
Content-Type: text/plain | |
Content-Length: 10 | |
Connection: keep-alive | |
Accept-Ranges: bytes | |
Cache-Control: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import time | |
class CronTab: | |
def __init__(self) -> None: | |
self.crontab_file = '/tmp/{}.crontab'.format(time.time()) | |
self.__init__crontab() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The files installed by the script conform to the Filesystem Hierarchy Standard: | |
# https://wiki.linuxfoundation.org/lsb/fhs | |
# The URL of the script project is: | |
# https://github.com/v2fly/fhs-install-v2ray | |
# The URL of the script is: | |
# https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vmess1://bc1a1d68-a317-478f-a14e-73f54d1ab143@dl.google.com:448?network=tcp&tls=true&tls.servername=dl.google.com&tls.allowinsecure=true#jp1 | |
vmess1://bc1a1d68-a317-478f-a14e-73f54d1ab143@dl.google.com:448?network=tcp&tls=true&tls.servername=dl.google.com&tls.allowinsecure=true#jp2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl stop v2ray | |
systemctl disable v2ray | |
service v2ray stop | |
update-rc.d -f v2ray remove | |
rm -rf /etc/v2ray/* | |
rm -rf /usr/bin/v2ray/* | |
rm -rf /var/log/v2ray/* | |
rm -rf /lib/systemd/system/v2ray.service | |
rm -rf /etc/init.d/v2ray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
dataFile = "data.json" | |
jsonData = {} | |
def init(): | |
if not os.path.isfile(dataFile): | |
saveData() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
states = { | |
'AK': 'Alaska', | |
'AL': 'Alabama', | |
'AR': 'Arkansas', | |
'AS': 'American Samoa', | |
'AZ': 'Arizona', | |
'CA': 'California', | |
'CO': 'Colorado', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
population = [34372, 37821, 45673, 67100, 69100, 70245] | |
year = ['2012', '2013', '2014', '2015', '2016', '2017'] | |
def getGreatestYear(): | |
maxPopulation = max(population) | |
index = population.index(maxPopulation) | |
return year[index] |
NewerOlder