The script reducer.ts
demonstrates reducer implementation for tree-structured data.
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
package main | |
import ( | |
"time" | |
"log" | |
"errors" | |
"encoding/json" | |
) | |
var timeLayout = "15:04" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.h-container { | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 100px; | |
height: 300px; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Strepsirrhini</title> | |
<meta name="viewport" content="user-scalable=no" /> | |
<style> | |
body { | |
margin: 0; | |
font-size: 1em; |
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 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 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
.git |
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 singledispatch | |
from dataclasses import dataclass | |
from typing import Union, get_args | |
@dataclass | |
class Foo: | |
id: str | |
name: str | |
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
<!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 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 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 ( | |
"crypto/rand" | |
"log" | |
"math/big" | |
) | |
func sixDigits() int64 { | |
max := big.NewInt(999999) |
NewerOlder