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 | |
from mitmproxy import http, ctx | |
from collections.abc import Iterable | |
import time | |
import jwt # pip install PyJWT / pipx inject mitmproxy PyJWT | |
import re | |
GLM_TOKEN = "[INSERT_YOUR_TOKEN]" | |
GLM_HOST = "open.bigmodel.cn" |
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 numpy as np | |
import csv | |
from tqdm import tqdm | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
def simulate_wait_times(num_machines, num_simulations, mean, std_dev): | |
wait_times = [] |
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
// should read | |
// https://hedzr.com/c++/algorithm/cxx-is_detected-and-detection-idioms | |
#include <iostream> | |
#include <type_traits> | |
#include <experimental/type_traits> | |
// AClass definition | |
class AClass { | |
public: | |
std::string dueDate; |
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
mpv --no-video "https://www.youtube.com/watch?v=jfKfPfyJRdk" --script-opts=ytdl_hook-ytdl_path=yt-dlp.exe |
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
export function fibonacci(num) { | |
if (num <= 1) return num; | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
} |
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 requests | |
import json | |
import sseclient | |
# API_KEY = 'sk-xxx' | |
def performRequestWithStreaming(): | |
reqUrl = 'https://api.openai.com/v1/chat/completions' | |
reqHeaders = { |
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> | |
<title>Base64 Encoder</title> | |
</head> | |
<body> | |
<textarea id="myTextArea" rows="10" cols="50"></textarea> | |
<br> | |
<button onclick="encodeText()">Encode to Base64</button> | |
<br> |
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
# built with chatgpt | |
import pyautogui | |
import cv2 # opencv-python | |
import numpy as np | |
import time | |
from datetime import datetime, timedelta | |
# also need: pillow |
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"> | |
<title>Parse Protobuf File in Frontend Example</title> | |
</head> | |
<body> | |
<textarea id="protobuf-content" rows="10" cols="80"></textarea> |
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
const ts = require("typescript"); | |
const {readFileSync} = require("fs"); | |
const filename = "source.ts"; | |
// tsconfig | |
const options = {"target": "ESNext", | |
"module": "ESNext", | |
"moduleResolution": "node"} | |
const compilerHost = { | |
...ts.createCompilerHost(options), |