Skip to content

Instantly share code, notes, and snippets.

3 cups required

Gaëtan Renaudeau gre

3 cups required
Block or report user

Report or block gre

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 tokens_per_holder_count.js
const request = require("request");
const { listTokens } = require("@ledgerhq/live-common/lib/currencies");
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const fetch = url =>
new Promise((resolve, reject) =>
request(url, (error, response, body) => {
View hooks.js
* I want to trigger something 5s after mount with some props
const Thing = ({ a, b }) => {
useEffect(() => {
const timeout = setTimeout(() => {
doTheThing(a, b);
}, 5000);
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 },
gre /
Last active Aug 14, 2019
Quick Guide for Ethereum Ledger Integration

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}>
gre / AspectRatioDiv.js
Created Mar 10, 2017
React AspectRatioDiv component, guarantees a div to keep a given ratio (assuming the layout don't change over time, otherwise call syncSize, or do a raf loop to call it)
View AspectRatioDiv.js
import React, {
} from "react";
const hasWindow = typeof window !== "undefined";
export default class AspectRatioDiv extends Component {
state: { width: ?number } = {
gre / ZZZ_output.js
Last active Jul 20, 2018
generate JavaScript WebGL API wrapper from the WebGL IDL. the output also contains flowtypes.
View ZZZ_output.js
/* eslint-disable */
class ArrayBufferView {}
class WebGLObject {
_id: number;
constructor (id: number) {
this._id = id;
class WebGLBuffer extends WebGLObject {}
You can’t perform that action at this time.