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
@gre
gre / easing.js
Last active Jan 24, 2020
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
View genAll.sh
#!/bin/bash
cd $(dirname $0)
./genOne.sh sync_Vertcoin Vertcoin
./genOne.sh sync_Dash Dash
./genOne.sh sync_Stakenet Stakenet
./genOne.sh sync_Viacoin Viacoin
./genOne.sh sync_PivX PivX
./genOne.sh sync_Komodo Komodo
@gre
gre / ethereum_ledger_integration.md
Last active Jan 8, 2020
Quick Guide for Ethereum Ledger Integration
View ethereum_ledger_integration.md

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

@gre
gre / package.json
Last active Dec 13, 2019
live-common in a nutshell
View package.json
{
"private": true,
"name": "send-example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@ledgerhq/hw-transport-node-hid-noevents": "canary",
"@ledgerhq/ledger-core": "alpha",
"@ledgerhq/live-common": "alpha",
View tokens_per_holder_count.js
require("babel-polyfill");
const request = require("request");
const { listTokens } = require("@ledgerhq/live-common/lib/currencies");
require("@ledgerhq/live-common/lib/load/tokens/ethereum/erc20");
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const fetch = url =>
new Promise((resolve, reject) =>
request(url, (error, response, body) => {
@gre
gre / scrollparent.js
Created Aug 3, 2016
get first parent scrollable container of a dom element
View scrollparent.js
// more minimal version of https://github.com/olahol/scrollparent.js/blob/master/scrollparent.js
const regex = /(auto|scroll)/;
const style = (node, prop) =>
getComputedStyle(node, null).getPropertyValue(prop);
const scroll = (node) =>
regex.test(
style(node, "overflow") +
style(node, "overflow-y") +
@gre
gre / pusher.scala
Created Aug 6, 2011
Using Pusher API with Play framework in scala for publishing events
View pusher.scala
// Implementing the publishing Pusher REST API
// @see http://pusher.com/docs/rest_api
// with Play (scala) Framework
// @see http://scala.playframework.org/
class Pusher {
val appId = Play.configuration.getProperty("pusher.appId")
val key = Play.configuration.getProperty("pusher.key")
val secret = Play.configuration.getProperty("pusher.secret")
@gre
gre / foo.glsl
Created Jun 18, 2014 — forked from glslioadmin/TEMPLATE.glsl
/!\ **DEV ONLY** - GLSL.io Transition (v1) used for the development
View foo.glsl
// N.B. this file is used only for the testing version of GLSL.io
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform float persp;
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);
@gre
gre / EasingFunctions.json
Last active Feb 2, 2019
DEPRECATED Please use http://github.com/gre/bezier-easing for latest vrrsion.
View EasingFunctions.json
{
"ease": [0.25, 0.1, 0.25, 1.0],
"linear": [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
}
You can’t perform that action at this time.