This file contains hidden or 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
type A = { | |
s: true; | |
i: {}; | |
}; | |
type B = { | |
s: true; | |
j: {}; | |
}; | |
type C = { | |
s: false; |
This file contains hidden or 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 re | |
import requests | |
import sys | |
from urllib.parse import parse_qs, urlencode, urlparse | |
def parse_curl_command(curl_command): | |
url_match = re.search(r"curl '([^']*)'", curl_command) | |
url = url_match.group(1) if url_match else None |
This file contains hidden or 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
from typing import Any, Dict | |
from uuid import UUID | |
from tqdm.auto import tqdm | |
from langchain_core.callbacks import BaseCallbackHandler | |
class BatchCallback(BaseCallbackHandler): | |
def __init__(self, total: int): | |
super().__init__() | |
self.count = 0 | |
self.progress_bar = tqdm(total=total) # define a progress bar |
This file contains hidden or 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
/// <summary> | |
/// Xaml extension providing globalized strings. | |
/// </summary> | |
/// <remarks> | |
/// Providing key itself if specified string is not found, | |
/// </remarks> | |
public class StringsExtension : IMarkupExtension<string> | |
{ | |
/// <summary> | |
/// Key of globalized strings. |
This file contains hidden or 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
@echo off | |
echo Waiting for UAC... | |
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~0"" ::","","runas",1)(window.close)&&exit | |
set /p vbspath=Please enter the path of vlc-protocol.vbs with double quotation mark (e.g. "C:\Program Files\VideoLAN\VLC\vlc-protocol.vbs"): | |
set command=wscript \"%vbspath:~1,-1%\" %%1 | |
reg.exe add HKCR\vlc /ve /d "URL:VLC" | |
reg.exe add HKCR\vlc /v "URL Protocol" | |
reg.exe add HKCR\vlc\shell\open\command /ve /d "%command%" | |
echo Done! | |
pause |
This file contains hidden or 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
addEventListener("fetch", (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); | |
async function handleRequest(request) { | |
let requestURL = new URL(request.url) |