Skip to content

Instantly share code, notes, and snippets.

View bneiluj's full-sized avatar
🏠
Working from home

Julien Bouteloup bneiluj

🏠
Working from home
View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@bneiluj
bneiluj / introrx.md
Created February 16, 2016 15:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@bneiluj
bneiluj / 0Option2ConstructorSummary.md
Created May 26, 2016 10:01 — forked from allenwb/0Option2ConstructorSummary.md
New ES6 constructor features and semantics: Alternative 2 manual super in derived classes

New ES6 Constructor Semantics and Usage Examples

Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.

An alternative version of this design automatically invokes the base constructor in most situations.

@bneiluj
bneiluj / Rinkeby.md
Created October 20, 2017 14:59 — forked from learner-long-life/Rinkeby.md
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@bneiluj
bneiluj / promise_monad.md
Created January 4, 2018 21:45 — forked from VictorTaelin/promise_monad.md
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing

@bneiluj
bneiluj / InviteLink.sol
Created November 21, 2018 14:23 — forked from Dobrokhvalov/InviteLink.sol
InviteLink module for ERC-1077
@bneiluj
bneiluj / auto-delegate.sh
Last active December 4, 2018 22:19 — forked from nckrtl/auto-delegate.sh
Auto delegate
echo "Enter your key password:"
read -s password
while true
do
amount_steak=$(gaiacli query account <comosaddr> --chain-id=9002 --trust-node=true | jq -r '.value.coins[0].amount')
if [[ $amount_steak > 0 && $amount_steak != "null" ]]; then
echo "About to stake ${amount_steak} steak"
echo "${password}" | gaiacli tx delegate --amount=${amount_steak}steak --from=crytter --validator=<cosmosvaloper> --chain-id=gaia-9001
fi
@bneiluj
bneiluj / gaia_install.sh
Last active December 5, 2018 13:01 — forked from kwunyeung/gaia_install.sh
bash script for installing go and gaia testnet on Ubuntu
#!/bin/bash
# Upgrade the system and install go
sudo apt update
sudo apt upgrade -y
sudo apt install gcc git make -y
sudo snap install --classic go
sudo mkdir -p /opt/go/bin
# Export environment variables