Instantly share code, notes, and snippets.

View consume_suspense_read.js
async function suspenseReadToPromise(read, ...args) {
let value;
try {
value = read(...args);
} catch (e) {
if (e && typeof e.then === "function") {
value = await e;
else {

Keybase proof

I hereby claim:

  • I am gre on github.
  • I am greweb ( on keybase.
  • I have a public key whose fingerprint is 70D1 29E9 37F5 DB8B BC04 6E46 92B0 2128 CF8C 915B

To claim this, I am signing this object:

View Finish.js
class Finish extends r.Component {
constructor(...e) {
var t
return (
(t = super(...e)),
Object.defineProperty(this, 'state', {
configurable: !0,
enumerable: !0,
writable: !0,
value: { emit: !1 },

How to integrate the Ledger device with a Ethereum Web Application

This is a quick guide to show how to integrate Ledger Ethereum libraries into an existing web application.

If you are starting a new DApp project from scratch, or simply are beginning in this Ethereum Smart Contract world, we have made create-dapp Starter Kit for you, it comes with a out-of-the-box support of Ledger and MetaMask and shows a complete smart contract example (that allows to get/set a value globally).

Whether you want to integrate on an existing app or bootstrap it from scratch with our starter kit, the follow guide will drive you to important part on how things work with the Ledger.

Prerequisites of the guide

View recordHistory_gcal_cryptofinance.js
function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
// Toggle a cell that is used in one of a CRYPTOFINANCE formula to force-trigger a refresh
var r = ss.getSheetByName("folio").getRange("A30");
var unit = r.getValues()[0][0];
// accumulate history
var sheet = ss.getSheetByName("History");
View main.js
import React, { Component } from "react";
class Counter extends Component {
state = { count: 1 };
onClick = () => this.setState(({ count }) => ({ count: count + 1 }));
render() {
return (
<button onClick={this.onClick}>
View AspectRatioDiv.js
import React, {
} from "react";
const hasWindow = typeof window !== "undefined";
export default class AspectRatioDiv extends Component {
state: { width: ?number } = {
View ZZZ_output.js
/* eslint-disable */
class ArrayBufferView {}
class WebGLObject {
_id: number;
constructor (id: number) {
this._id = id;
class WebGLBuffer extends WebGLObject {}
View dedup_list_of_all_gl_react_cookbook_example_gl_calls.txt
View index.js
document.write(`<link rel="stylesheet" href="" />`);
var Prism = require('prismjs');
var code = [
"const c = `",
"// do something",
"float a = p.x * p.y;",
"// do something else",