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
| # pip install google-api-python-client python-dotenv | |
| from typing import Optional, List, Tuple, Dict | |
| from dataclasses import dataclass | |
| import http.cookies | |
| import os | |
| import subprocess | |
| import sys | |
| import urllib.parse |
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
| <?php | |
| function println($s) | |
| { | |
| echo "$s\n"; | |
| } | |
| function shell_exec_trim($cmd, $nonzero_throw = true) | |
| { | |
| $lines = array(); |
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 KeyEnumOf<T> = {[P in keyof T]: P} | |
| class Enum { | |
| static make<T>(source: T): Readonly<KeyEnumOf<T>> { | |
| let result = {} as KeyEnumOf<T>; | |
| for (const k in source) { | |
| result[k] = k; | |
| } | |
| return Object.freeze(result); | |
| } |
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
| package main | |
| import "fmt" | |
| // ------------------------------------------------ | |
| type F1[T any, R any] interface { | |
| Apply(T) R | |
| } |
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
| package com.example.stages; | |
| import java.util.Optional; | |
| interface Person<Name, Age> { | |
| Name name(); | |
| Age age(); | |
| } | |
| record Person_Any<Name, Age>(Name name, Age age) implements Person<Name, Age> {} |
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
| using System; | |
| abstract class TySub<A, B> | |
| { | |
| public abstract B Cast(A a); | |
| } | |
| class TySub_Refl<A, B> : TySub<A, B> | |
| where A : B | |
| { |
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 abc import ABCMeta | |
| from abc import abstractmethod | |
| from dataclasses import dataclass | |
| from typing import Any | |
| from typing import Callable | |
| from typing import Generic | |
| from typing import Optional | |
| from typing import TypeVar | |
| from typing import cast |
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
| #nullable enable | |
| using System; | |
| // --- | |
| interface Hk<W, A> { } | |
| // --- |
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
| package example.playground.parserclass; | |
| import lombok.AllArgsConstructor; | |
| import lombok.EqualsAndHashCode; | |
| import lombok.RequiredArgsConstructor; | |
| import lombok.Value; | |
| import lombok.experimental.Delegate; | |
| import java.util.function.BiFunction; | |
| import java.util.function.Function; |
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 Control.Exception | |
| import System.IO.Unsafe | |
| match :: (a -> b) -> a -> Maybe b | |
| match m a = unsafeDupablePerformIO $ | |
| handle (\(PatternMatchFail _) -> pure Nothing) $ do | |
| x <- evaluate (m a) | |
| return (Just x) | |
| what :: Either a b -> Maybe b |