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
function URLPathname(pathname, search, hash) { | |
this.pathname = pathname; | |
this.search = new URLSearchParams(search); | |
this.hash = hash; | |
} | |
URLPathname.prototype.resolve = function (parameters) { | |
if (this.pathname) { | |
var resolved = this.pathname; |
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 [searchParams, setSearchParams] = useSearchParams({ [searchParam]: defaultValue, }) | |
useEffect(() => { | |
setSearchParams( | |
tap( | |
when( | |
compose(anyPass([isEmpty, isNil]), invokeGet(tabSearchParam)), | |
invokeSet(searchParam, defaultValue) | |
) | |
) |
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 hexs = [ | |
// Karjala | |
[ '538854', 'be2928', '000000' ], | |
// Ludic | |
[ '529f54', 'be2928', '3d3b7b' ], | |
// Veps | |
[ '16b370', 'ffff00', '155cdc' ], | |
// Russian-side Finnish | |
[ 'ffd301', 'ef2d20', '0167b3' ], | |
// Izhorian |
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
interface DoubleEnumeration<const Tuples extends ReadonlyArray<readonly [any, any]>> { | |
[(Key in Tuples[number]) as Key[0]]: Key[1]; | |
[(Key in Tuples[number]) as Key[1]]: Key[0]; | |
has(key: Tuples[number][number]): boolean; | |
keys(): IterableIterator<Tuples[number][0]>; | |
values(): IterableIterator<Tuples[number][1]>; |
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
import { useRouter } from 'next/router'; | |
import { useCallback, useId } from 'react'; | |
import { FilterSegments, FilterTranslations } from '@/components/filters/filters.enumeration'; | |
import { Select } from '@/components/select/select'; | |
import { setSearchParams, stringify } from '@/utilities/methods'; | |
const Filters = Enumeration.of(['First', 'Second']) |
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
# -v --invert-match | |
git branch -D $(git branch | grep -v main) |
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
let pathname = new URLPathname({ | |
pathname: '/user/:user/todos/:todo', | |
search: 'tab=aaa', | |
hash: 'section', | |
}); | |
pathname.toString([ | |
['user', 1], |