<!DOCTYPE html><title>Hello, World!</title>
- doctype is mandatory
- title is mandatory
- head is not
- body is not
Verified with https://validator.w3.org/
import { forwardRef } from 'react'; | |
// ref is optional with forwardRef(), I want it to be mandatory | |
// type ... = ReturnType<typeof forwardRef<T, P>>; | |
type ForwardMandatoryRefComponent<T, P> = React.ForwardRefExoticComponent< | |
React.PropsWithoutRef<P> & React.RefAttributes<T> & { ref: React.Ref<T> } | |
>; | |
type Props = { | |
// Why? https://stackoverflow.com/a/25367640 |
// https://gist.github.com/tkrotoff/c6dd1cabf5570906724097c6e3f65a12 | |
// https://stackoverflow.com/a/67911932 | |
export function wait(ms: number, options: { signal?: AbortSignal } = {}) { | |
const { signal } = options; | |
return new Promise<void>((resolve, reject) => { | |
// FIXME Not supported by Jest 29.3.1 + Node.js 19.3.0 | |
//signal?.throwIfAborted(); | |
if (signal?.aborted) reject(signal.reason); |
/* eslint-disable guard-for-in, @typescript-eslint/ban-types, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */ | |
import { Primitive } from 'type-fest'; | |
// [Generic way to convert all instances of null to undefined in TypeScript](https://stackoverflow.com/q/50374869) | |
// ["I intend to stop using `null` in my JS code in favor of `undefined`"](https://github.com/sindresorhus/meta/discussions/7) | |
// [Proposal: NullToUndefined and UndefinedToNull](https://github.com/sindresorhus/type-fest/issues/603) | |
// Types implementation inspired by |
import { useRouter } from 'next/router'; | |
import { useEffect } from 'react'; | |
import { useProgressBar } from './useProgressBar'; | |
// https://github.com/twbs/bootstrap/blob/v5.3.0-alpha1/scss/_variables.scss#L1529 | |
const transitionSpeed = 600; | |
// https://gist.github.com/tkrotoff/db8a8106cc93ae797ea968d78ea28047 | |
// https://stackoverflow.com/q/60755316 |
<!DOCTYPE html><title>Hello, World!</title>
Verified with https://validator.w3.org/
namespace Log | |
{ | |
/// <summary> | |
/// Helps you trace the execution of your code. | |
/// </summary> | |
/// <remarks> | |
/// Same as System.Diagnostics.Trace but adds the class and method names to the trace message.<br/> | |
/// <br/> | |
/// More documentation about Trace and Debug:<br/> | |
/// <list type="bullet"> |
class Event < ActiveRecord::Base | |
include EventJSON | |
attr_accessible *EventJSON.attributes | |
validates :starts_at, presence: true | |
validates :ends_at, presence: true | |
validates :all_day, inclusion: { in: [true, false] } | |
end |
#!/usr/bin/env ruby | |
# A simple regexp to manipulate svn dump files. | |
# | |
# Example of a svn dump file: | |
# | |
# Node-path: MySourceCode.cpp | |
# Node-kind: file | |
# Node-action: add | |
# Prop-content-length: 10 |