Skip to content

Instantly share code, notes, and snippets.

View gre's full-sized avatar
3 cups required

@greweb gre

3 cups required
View GitHub Profile
@gre
gre / script.js
Created June 13, 2022 19:28
objkt.com batch send script to run on the page of "Actions" of the token
// between the `` you add all the address you want to send to
addresses=``.split("\n").map(_=>_.trim()).filter(Boolean)
async function main() {
$button = [...document.querySelectorAll("button")].filter(
(b) => b.innerText === "Add recipient"
)[0];
let i = 0;
for (a of addresses) {
const $amount = document.getElementById("amount_" + i);
const $address = document.getElementById("address_" + i);
@gre
gre / text2speech_playframework.scala
Created August 10, 2011 18:06
Play framework + Scala : a text to speech in 2 line of code using google translate - this is an action, put it in any controller ;)
def speech(text:String) = {
val audio = WS.url("http://translate.google.com/translate_tts?tl=en").setParameter("q", text).get()
response.contentType = audio.getContentType()
audio.getStream()
}
/*
This is a Play! framework controller's action.
Put it in any scala controller.
Don't forget to import play.libs.WS
*/
@gre
gre / ethereum_ledger_integration.md
Last active March 8, 2022 05:41
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

@gre
gre / README.md
Last active November 12, 2021 15:20
Boilerplate of a JS1K submission + JSCrush & uglify tools

JS1K Boilerplate

Build tools

Install tools

npm install
@gre
gre / deploy.sh
Last active October 8, 2021 00:33
Super-small scripts for easy PlayFramework deployment
#!/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";
@gre
gre / gist:4744775
Created February 9, 2013 10:19
Convert all *.wav in .mp3 and .ogg (useful for HTML5 audio support on all browsers...)
for f in *.wav; do sox $f ${f%%.wav}.mp3; sox $f ${f%%.wav}.ogg; done
precision highp float;
varying vec2 uv;
uniform float time;
uniform sampler2D img;
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) {
return a + b*cos( 6.28318*(c*t+d) );
}
vec3 color (float t) {
return palette(
t,
precision highp float;
varying vec2 uv;
uniform float time;
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) {
return a + b*cos( 6.28318*(c*t+d) );
}
vec3 color (float t) {
return palette(
@gre
gre / Application.scala
Created November 12, 2012 11:10
Generate Zip on-the-fly with Play!> Framework (2.1+)
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller {
def zip = Action {
import play.api.libs.iteratee._
import java.util.zip._
@gre
gre / cube.glsl
Created June 12, 2014 17:13 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform float persp;
uniform float unzoom;
uniform float reflection;