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 } from "../types/json"; | |
| import doesThrow from "../doesThrow"; | |
| import { useEffect, useState } from "react"; | |
| type Target = "_replace" | "_blank" | "_self" | "_parent" | "_top"; | |
| type Dispatch<A> = (value: A, targetOrNewTab?: Target | boolean) => void; | |
| type SetSearchParamStateAction<S> = S | ((prevState?: S) => S); | |
| function encodeParam(obj: Json): string { | |
| if (typeof obj === "string" && doesThrow(JSON.parse, obj)) { |
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 {useEffect, useRef, useState} from "react"; | |
| const getSeconds = () => new Date().valueOf() / 1000; | |
| const EPSILON = 0.001; | |
| interface Spring { | |
| prevDisplacement: number, | |
| prevVelocity: number, | |
| goal: number, |
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 SortKey<T> = string | ((v: T) => unknown); | |
| type SortOrder = "asc" | "desc"; | |
| type NullMode = "start" | "end"; | |
| interface SortStep<T> { | |
| key: SortKey<T> | |
| order?: SortOrder, | |
| nulls?: NullMode | |
| } | |
| export function getCompareFn<T>(...sortKeys: (SortKey<T> | SortStep<T>)[]) { |
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 dataclasses import dataclass, field | |
| from typing import Any | |
| @dataclass | |
| class Feature: | |
| type: str | |
| id: str | |
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 {v4 as uuidv4} from "uuid"; | |
| import React, {createContext, ReactNode, useContext, useEffect, useMemo, useRef, useState} from "react"; | |
| import clsx from "clsx"; | |
| import {ClipLoader} from "react-spinners"; | |
| import {useMap, useSet} from "../utils/hooks"; | |
| interface IAlert { | |
| id: string, | |
| content?: ReactNode, // Content to display, can be string or custom children |
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 selenium import webdriver | |
| import requests | |
| import figa | |
| from redis import Redis | |
| from pprint import pp | |
| @figa.config | |
| class Config: | |
| default = "config.json" |
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
| { | |
| "number": 12, | |
| "string": "Hello, world!", | |
| "fruits": ["apple", "pear"], | |
| "person": { | |
| "name": "Zach", | |
| "age": 20 | |
| } | |
| } |
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
| local url_query = {arg1="val1", arg2="val2"} | |
| local post_json = {a=1, b=2, this="is json"} | |
| local HttpService = game:GetService("HttpService") | |
| local options = { | |
| Url = ("https://httpbin.org/post?%s=%s&%s=%s"):format("arg1", url_query.arg1, "arg2", url_query.arg2), | |
| Method = "POST", | |
| Headers = {["Content-Type"] = "application/json"}, | |
| Body = HttpService:JSONEncode(post_json) |
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
| local rgb = Color3.fromRGB | |
| local Color = { | |
| Red = { | |
| [50] = rgb(255, 235, 238); | |
| [100] = rgb(255, 205, 210); | |
| [200] = rgb(239, 154, 154); | |
| [300] = rgb(229, 115, 115); | |
| [400] = rgb(239, 83, 80); |
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
| local HttpService = game:GetService("HttpService") | |
| local options = { | |
| Url = "https://httpbin.org/post?arg=value", | |
| Method = "POST", | |
| Headers = {["Content-Type"] = "application/json"}, | |
| Body = HttpService:JSONEncode( {this="json"} ) | |
| } | |
| local r = HttpService:RequestAsync(options) |
NewerOlder