Skip to content

Instantly share code, notes, and snippets.

package example.playground.parsec;
import lombok.EqualsAndHashCode;
import lombok.Value;
import lombok.val;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
{-# Language GADTs #-}
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
import Control.Monad
---
class Rel a where
type Delta a :: *
from abc import ABC
from abc import abstractmethod
from abc import abstractproperty
from dataclasses import dataclass, field
from typing import Any
from typing import AsyncGenerator
from typing import Awaitable
from typing import Callable
from typing import Generator
from typing import Generic
package com.uber.playground.typedexpr;
import lombok.Value;
import lombok.val;
import java.util.function.Function;
abstract class Type<T extends Type<T>> {
private Type() {}
package com.uber.playground;
import lombok.Value;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Stack;
interface Expr<T extends Expr<T>> {
package com.uber.playground;
import lombok.NonNull;
import lombok.SneakyThrows;
import lombok.Value;
import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.InvocationTargetException;
@Garciat
Garciat / di.py
Last active April 27, 2021 19:33
import inspect
from typing import Any, Dict, Iterable, List, get_type_hints
def linearize_type_hierarchy(root: type) -> Iterable[type]:
if root is object:
return
yield root
for node in inspect.getclasstree([root]):
if isinstance(node, tuple):
function delay(n) {
return new Promise(accept => setTimeout(() => accept(), n));
}
async function cleanUp() {
let xs = Array.from(document.querySelectorAll('[aria-label=Edit]')).slice(0, 10);
console.log(xs);
xs.forEach(n => n.click());
await delay(1000);
package kata
// LastDigit kata
func LastDigit(as []int) int {
if len(as) == 0 {
return 1
}
return newModPowBase(&simpleGen{
state: 1,
base: as[0],
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Awaitable, Generic, Generator, Iterable, \
List, Tuple, TypeVar, cast
###
T = TypeVar('T')
R = TypeVar('R')