The script reducer.ts
demonstrates reducer implementation for tree-structured data.
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
class Reporter(Protocol): | |
def report_error(self, node: ast.AST) -> None: | |
... | |
class ConcreteReporter(Reporter): | |
def __init__(self, rule_id: str, filename: str) -> None: | |
... |
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 typing import Any, Callable, TypeVar, Type, cast, Union, Protocol | |
from functools import singledispatchmethod | |
T = TypeVar("T", int, str) | |
def stricttype( | |
type_: Type[T], | |
) -> Callable[[Callable[[Any, Any], None]], Callable[[Any, T], None]]: | |
def inner(method: Callable[[Any, Any], None]) -> Callable[[Any, T], None]: |
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 functools import singledispatch | |
from dataclasses import dataclass | |
from typing import Union, get_args | |
@dataclass | |
class Foo: | |
id: str | |
name: 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
html, |
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
const useTimeout = (delay) => { | |
const [ timeoutFunc, setFunction ] = useState(null); | |
useEffect( | |
() => { | |
if (!timeoutFunc) { | |
return; | |
} | |
let mounted = true; |
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
#!/usr/bin/env bash | |
distdir="$(pwd)/dist$RANDOM$RANDOM" | |
mkdir "$distdir" | |
for input in "$@"; do | |
base=$(basename "$input") | |
output="$distdir/${base,,}" | |
ffmpeg -i "$input" \ |
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
# ffmpeg -i input.mp4 -crf 28 -b:a 128k -color_range 1 -color_trc arib-std-b67 -color_primaries bt2020 -colorspace bt2020nc output_28.mp4 | |
# ffmpeg -i output28.mp4 -c copy -map 0 -segment_time 00:01:00 -reset_timestamps 1 -f segment output_%03d.mp4 | |
ffmpeg -i input.mp4 -crf 28 -b:a 128k -color_range 1 -color_trc arib-std-b67 -color_primaries bt2020 -colorspace bt2020nc -segment_time 60 -f segment -reset_timestamps 1 output_%03d.mp4 |
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
<html> | |
<head> | |
<style> | |
.item { | |
display: block; | |
overflow: hidden; | |
} | |
.head { | |
height: 30px; | |
line-height: 30px; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>iOS focus Test</title> | |
<style> | |
.modal { | |
transition: opacity 0.3s; |
NewerOlder