Skip to content

Instantly share code, notes, and snippets.

View none23's full-sized avatar

Nick Anisimov none23

View GitHub Profile
import React, { useState } from "react";
import { render } from "react-dom";
import styled from "@emotion/styled";
const Main = styled.main`
font-family: sans-serif;
text-align: center;
color: red;
background: black !important;
height: 100vh;
const { abs } = Math;
const { isNaN } = Number;
const NBSP = " ";
export function plural(one: string, two?: Maybe<string>, five?: Maybe<string>) {
return (quantiry: Maybe<number>) =>
pluralize(absInt(number), [one, two ?? one, five ?? two ?? one]);
}
function nbspJoin<T = number | string>(...arr: T[]): string {
@none23
none23 / Tooltip.tsx
Created July 20, 2020 21:40
Tooltip
import * as React from 'react';
import styled from 'styled-components';
interface Params {
showDelay: number;
hideDelay: number;
}
type Actions = {
show: () => void;
/**
* Global declarations (these can be used without importing)
*/
/**
* Номинальные типы "для бедных".
* Например `type Foo = `Nominal<'Foo', string>` - подтип строки, который:
* - может быть использован, кок строка (можно передать `let x: Foo` в функцию `function(arg:string){...}`)
* - не принимает произвольную строку (нельзя передать `let x: string` в функцию `function(arg:Foo){...}`)
* - не совместим с `type Bar = Nominal<'Bar', string>`
{
background: #111;
color: #ccc;
text-shadow: none;
}
::-webkit-scrollbar
{
width: 10px !important;
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Author: Twily
Description: Minimal flat styled tabs for Australis
Compatibility: -- Firefox 43.0.1 --
Website: http://twily.info/
Useful search tags within this css:
@none23
none23 / cvimrc
Last active December 4, 2016 11:21
my cvimrc
" Settings
set nohud
set noautofocus
set smoothscroll
set changelog
let blacklists = []
let searchengine y = "https://www.youtube.com/search?q="
let searchalias g = "google"
set completeonopen
set defaultnewtabpage