Skip to content

Instantly share code, notes, and snippets.

View revelt's full-sized avatar
🤗
hello

Roy Revelt revelt

🤗
hello
View GitHub Profile
@revelt
revelt / all-vowels.txt
Last active May 25, 2022 22:02
List of all vowels, covers all Latin and Cyrillic alphabets and diacritics
aeiouyàáâãäåæèéêëìíîïòóôõöøùúûüýÿāăąēĕėęěĩīĭįijōŏőœũūŭůűųŷǎǐǒǔǖǘǚǜǟǡǣǫǭǻǽǿȁȃȅȇȉȋȍȏȕȗȧȩȫȭȯȱȳ̇аеийоуыэюяѐёєіїѝў
@revelt
revelt / abort-requests-in-react.js
Created May 21, 2022 09:34 — forked from viclafouch/abort-requests-in-react.js
A React component that fetching data on mount and avoiding memory leaks on unmount with AbortController
import React, { useState, useEffect, useCallback } from 'react'
function Posts() {
const [isLoading, setIsLoading] = useState(true)
const [posts, setPosts] = useState([])
const fetchPosts = useCallback(async controller => {
try {
// Imagine that the fetch is going to take 3 seconds to finish
await new Promise(resolve => setTimeout(resolve, 3000))
@revelt
revelt / improved-sr-only.markdown
Created December 14, 2021 17:22 — forked from ffoodd/improved-sr-only.markdown
Improved .sr-only

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@revelt
revelt / esbuild.js
Created April 3, 2021 11:54
working esbuild runner script, to DRY all esbuild calls within lerna monorepo, program sources are in typescript
const path = require("path");
const camelCase = require("lodash.camelcase");
const mode = process.env.MODE;
const name = path.basename(path.resolve("./"));
const pkg = require(path.join(path.resolve("./"), `package.json`));
// pure here means they can be removed if unused (if minifying is on, of course)
const pure =
mode === "dev"
? []
/**
* @name string-strip-html
* @fileoverview Strips HTML tags from strings. No parser, accepts mixed sources.
* @version 8.2.9
* @author Roy Revelt, Codsen Ltd
* @license MIT
* {@link https://codsen.com/os/string-strip-html/}
*/
var ie=Object.create,w=Object.defineProperty,oe=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty,re=Object.getOwnPropertyNames,ue=Object.getOwnPropertyDescriptor,Y=Object.getOwnPropertySymbols,ge=Object.prototype.propertyIsEnumerable;var z=(n,r,c)=>r in n?w(n,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):n[r]=c,L=(n,r)=>{for(var c in r||(r={}))V.call(r,c)&&z(n,c,r[c]);if(Y)for(var c of Y(r))ge.call(r,c)&&z(n,c,r[c]);return n},K=n=>w(n,"__esModule",{value:!0});var $e=(n,r)=>{for(var c in r)w(n,c,{get:r[c],enumerable:!0})},me=(n,r,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let O of re(r))!V.call(n,O)&&O!=="default"&&w(n,O,{get:()=>r[O],enumerable:!(c=ue(r,O))||c.enumerable});return n},C=n=>me(K(w(n!=null?ie(oe(n)):{},"default",n&&n.__esModule&&"defa
/**
* string-strip-html
* Strips HTML tags from strings. No parser, accepts mixed sources.
* Version: 8.2.9
* Author: Roy Revelt, Codsen Ltd
* License: MIT
* Homepage: https://codsen.com/os/string-strip-html/
*/
'use strict';
/**
* @name string-strip-html
* @fileoverview Strips HTML tags from strings. No parser, accepts mixed sources.
* @version 8.2.9
* @author Roy Revelt, Codsen Ltd
* @license MIT
* {@link https://codsen.com/os/string-strip-html/}
*/
var __create = Object.create;
@revelt
revelt / config
Created November 27, 2020 16:43 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[sendemail]
smtpencryption = tls
@revelt
revelt / storybook_spec.js
Created March 24, 2020 16:41 — forked from xogeny/storybook_spec.js
Cypress testing of Storybook
// Tests built around our Storybook
describe('Storybook', () => {
beforeEach(() => {
// Visiting our app before each test removes any state build up from
// previous tests. Visiting acts as if we closed a tab and opened a fresh one.
// In this case, we are using the publicly accessible AirBnB react-dates Storybook
cy.visit('http://airbnb.io/react-dates/')
})
// Let's build some tests around the DateRangePicker
context('DateRangePicker', () => {
@revelt
revelt / button-overlapping.html
Created August 13, 2019 09:43 — forked from hteumeuleu/button-overlapping.html
Example of button overlapping for @irmavdk on #emailgeeks Slack
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>button overlapping</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:600px; background:#e5f3f6;">
<tr>
<td>