Skip to content

Instantly share code, notes, and snippets.

💭
researching video players

Tom Byrer tomByrer

💭
researching video players
Block or report user

Report or block tomByrer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View little-vdom-decompiled.js
/* eslint-disable no-unused-vars */
/* eslint-disable no-else-return */
// JSX constructor, similar to createElement()
export const h = (type, props, ...children) => {
return {
type,
// Props will be an object for components and DOM nodes, but a string for
// text nodes
props,
@sw-yx
sw-yx / react-router-dom-v6.d.ts
Last active Mar 31, 2020
react router dom v6 types - i have not tested this in all cases, nor have i ensured this covers the full api, - this should just be a nice drop in single .d.ts file that covers basic usecases detailed in https://dev.to/emreloper/react-router-v6-in-two-minutes-2i96, including inlining the necessary types for history and react-router
View react-router-dom-v6.d.ts
// // with thanks
// https://dev.to/emreloper/react-router-v6-in-two-minutes-2i96
// https://github.com/ReactTraining/react-router/blob/dev/docs/installation/getting-started.md
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9d29adedf662de685356f711951ef8b9e8342865/types/react-router/index.d.ts#L1
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9d29adedf662de685356f711951ef8b9e8342865/types/react-router-dom/index.d.ts#L1
declare module "react-router-dom" {
import * as React from 'react';
/**
@seanbrwh
seanbrwh / JOBSITES.md
Created Dec 4, 2019
List of job searching websites
View JOBSITES.md
@necolas
necolas / using-OnLayout.js
Last active Mar 14, 2019
React Pressable / OnLayout
View using-OnLayout.js
/**
* OnLayout is built upon: View (and ResizeObserver), StyleSheet
*/
const elementBreakpoints = {
small: { minWidth: 200 },
medium: { minWidth: 300 }
large: { minWidth: 500 }
};
View minimal-analytics-snippet.js
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@dominictarr
dominictarr / readme.md
Created Nov 26, 2018
statement on event-stream compromise
View readme.md

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@zeusdeux
zeusdeux / transaction.js
Created Nov 20, 2018
Simple transaction in js
View transaction.js
/**
* @description
* Returns a transaction object which is composed of operations.
* The transaction resolves only when all operations it is made of succeed.
* If any operation fails, it reverts ALL operations and rejects the transaction.
* If any of the reverts also fail, then it rejects the transaction as well
* with an error that can help the developer manually make data consistent.
*
* @param {function} transaction - A function that builds operations and calls run on them
*
View *suspense-loader.md

suspense-loader

Installation (sorry)

npm i THIS_URL

Usage

You can’t perform that action at this time.