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 Aug 20, 2019
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: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@gre
gre / ethereum_ledger_integration.md
Last active Aug 14, 2019
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 / 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 / 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]
}
@gre
gre / nsSMILKeySpline.cpp
Created Feb 27, 2012
copy pasted from the Firefox source code - this is how Firefox render CSS Transitions Timing Functions.
View nsSMILKeySpline.cpp
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
@gre
gre / README.md
Last active Jan 14, 2019
Standalone minimal version of Google Photos Albums list in order for you to share photos with family and with link to multiple shared google photos albums
View README.md

DWTFYW

Disclaimer:

  • no warranty this will work for you!
  • I'm not responsible of how you use this!
  • READ, VERIFY and TEST the CODE before using!
@gre
gre / deploy.sh
Last active Nov 15, 2018
Super-small scripts for easy PlayFramework deployment
View deploy.sh
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
rsync -va target/ $REMOTE:$REMOTE_APP/target;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
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 {
You can’t perform that action at this time.