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 generateTypeScript($dummy): string { | |
$output = "// " . $dummy['description'] . "\n"; | |
$output .= "type " . $dummy['name'] . " = (_: {\n"; | |
$output .= generateProperties($dummy['parameters']['properties'], $dummy['parameters']['required'], false); | |
$output .= "}) => any;\n"; | |
return $output; | |
} | |
function generateProperties($properties, $required, $indent): string { | |
$output = ''; |
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
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.action_chains import ActionChains | |
from io import BytesIO | |
from base64 import b64decode | |
from PIL import Image | |
from tkinter import Tk | |
from tkinter.filedialog import askopenfilename, asksaveasfilename |
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 declare(strict_types=1); | |
use Swoole\WebSocket\Server; | |
use Swoole\WebSocket\Frame; | |
const CONCURRENT_MAX = 5; | |
const INPUT_TYPE_COL = 'input'; | |
$server = new Server("0.0.0.0", 9502); | |
$table = new Swoole\Table(CONCURRENT_MAX); | |
$table->column(INPUT_TYPE_COL, Swoole\Table::TYPE_INT, 4); |
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 sys | |
import time | |
from requests import Session | |
import requests | |
import urllib.parse | |
from bs4 import BeautifulSoup | |
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
from functools import partial | |
from pathlib import Path | |
print_app = partial(print, "SRT Fix:") | |
files = [f for f in Path().iterdir() if f.is_file()] | |
mp4 = sorted([f for f in files if f.suffix.lower().endswith(".mp4")]) | |
srt = sorted([f for f in files if f.suffix.lower().endswith(".srt")]) | |
assert len(mp4) == len(srt), f"Count miss! MP4s: {len(mp4)}, SRTs: {len(srt)}." | |
print_app( | |
f"Looking at {len(mp4)} MP4 files with matching subs starting with" |
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
using UnityEngine; | |
#if UNITY_EDITOR || DEBUG | |
using System; | |
using UnityEngine.SceneManagement; | |
#endif | |
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : MonoBehaviour { | |
private static T _instance = null; | |
public static T Instance { |
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 sqlite3 | |
import random | |
def seeded_random_collation(string1, string2): | |
return random.randint(-1, 1) | |
try: | |
con = sqlite3.connect("db.sqlite") |