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
#!/usr/bin/env pwsh | |
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process | |
function Start-Command ([String]$Path, [String]$Arguments) { | |
$pinfo = New-Object System.Diagnostics.ProcessStartInfo | |
$pinfo.FileName = $Path | |
$pinfo.RedirectStandardError = $true | |
$pinfo.RedirectStandardOutput = $true | |
$pinfo.UseShellExecute = $false | |
$pinfo.Arguments = $Arguments |
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
function PartiallyDownload-File([String]$Uri, [String]$OutFile, [Int64]$Start, [Int64]$End = 0, [String]$UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36') { | |
[Net.ServicePointManager]::DefaultConnectionLimit = [Int32]::MaxValue | |
$Request = [Net.WebRequest]::Create($Uri) | |
if ($End) { | |
$Request.AddRange($Start, $End) | |
} | |
else { | |
$Request.AddRange($Start) | |
} | |
$Request.UserAgent = $UserAgent |
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
#!/usr/bin/env pwsh | |
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process | |
function Start-Command ([String]$Path, [String]$Arguments) { | |
$pinfo = New-Object System.Diagnostics.ProcessStartInfo | |
$pinfo.FileName = $Path | |
$pinfo.RedirectStandardError = $true | |
$pinfo.RedirectStandardOutput = $true | |
$pinfo.UseShellExecute = $false | |
$pinfo.Arguments = $Arguments |
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 argparse | |
import json | |
import os | |
import re | |
import requests | |
import requests.exceptions | |
import threading | |
import zipfile | |
from requests.models import Response |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script src="https://cdn.jsdelivr.net/gh/w3c/IntersectionObserver/polyfill/intersection-observer.min.js"></script> |
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
/** | |
* Random number generator "xoshiro128**". | |
* @see http://prng.di.unimi.it/xoshiro128starstar.c | |
*/ | |
class Xoshiro128ss { | |
/** | |
* Init the RNG with given seed. | |
* The default seed is taken from current timestamp. | |
* @param {Number} [a] | |
* @param {Number} [b] |
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
<?php | |
/* | |
PHAR打包脚本 | |
使用方法: | |
php phar-builder.php /path/to/build/config.json | |
打包配置文件: | |
{ | |
// 项目名称,也是打包的文件名称 |
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 getpass | |
import pydes | |
import re | |
import requests | |
username = input('Username: ') | |
password = getpass.getpass('Password: ') | |
session = requests.Session() | |
response = session.get('https://icas.jnu.edu.cn/cas/login') |
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 argparse | |
import multiprocessing | |
import re | |
import os | |
import sys | |
import time | |
def parseFileSize(string: str) -> int: | |
try: | |
size, unit = re.search(r'^([0-9]*\.?[0-9]+)((?:b|kb|mb|gb)?)$', (string if type(string) is str else str(string)).lower()).groups() |
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 ctypes | |
class Xoshiro128ss: | |
def __init__(self, a: int, b: int, c: int, d: int): | |
self.s = tuple(ctypes.c_uint32(x) for x in (a, b, c, d)) | |
self.t = ctypes.c_uint32() | |
self.r = ctypes.c_uint32() | |
def randInt(self) -> int: | |
s0, s1, s2, s3 = self.s |
OlderNewer