Skip to content

Instantly share code, notes, and snippets.


Erko Bridee erkobridee

View GitHub Profile
erkobridee /
Last active Mar 1, 2021
[JS][TS][NPM][GitHub Packages] how to create a library
erkobridee / react_hook_useWait.ts
Last active Apr 27, 2020
safe way to use setTimeout or setInterval through react hooks
View react_hook_useWait.ts
import * as React from 'react';
export enum JSTypeof {
UNDEFINED = 'undefined',
FUNCTION = 'function',
OBJECT = 'object',
STRING = 'string',
NUMBER = 'number',
View detect_location.js
version updated to use the fetch API
function request(url) {
return fetch(url).then(response => response.json());
erkobridee /
Last active Jan 17, 2020
[gatsby testing] useful links #gastbyjs #js #testing
erkobridee / iframe-content.css
Last active Dec 2, 2019
set focus to an iframe after loads its content
View iframe-content.css
// hack to enable touch after focus on the iframe
body {
touch-action: auto;
erkobridee /
Created Nov 8, 2019
Notepad (paste in Chrome's addressbar)

past the following string into the google chrome address bar:

data:text/html,<html contenteditable>
erkobridee /
Last active Jun 21, 2019
useful way to backup a whole repository from on remote to another remote server on an Unix base system
# define a full backup of a git repository from one remote server to another one
mkdir $workDir
erkobridee / multiline_regexp_sample.js
Created Apr 30, 2019
example of how to write a multiline RegExp and keep under row max length lint rules
View multiline_regexp_sample.js
const DEVICES_REGEXP = new RegExp([
/|IEMobile|Opera Mini/,
].map(function(r) {return r.source}).join(''), 'i');
// output: /Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i