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
@bneiluj
bneiluj / ReactReduxNoThunk.js
Created October 28, 2016 14:00
React Redux - Fetching asynchronous data without using Thunk
import * as constants from './../constants';
import axios from 'axios';
import config from './../config';
function fetchProductsType(products) {
return {
type: constants.FETCH_PRODUCTS,
payload: products
};
}

Keybase proof

I hereby claim:

  • I am bneiluj on github.
  • I am bneiluj (https://keybase.io/bneiluj) on keybase.
  • I have a public key whose fingerprint is 5F35 46F6 85E9 8C45 82EB 57D5 1DD9 A932 591F A928

To claim this, I am signing this object:

@bneiluj
bneiluj / voting.sol
Created August 11, 2016 16:02
An ethereum Voting smart contract - The persons behind the addresses can then choose to either vote themselves or to delegate their vote to a person they trust.
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation, weight = 1 when
// the chairman gives right to vote to the voter
bool voted; // if true, that person already voted
address delegate; // person delegated to
@bneiluj
bneiluj / simpleAuction.sol
Created August 11, 2016 16:00
An Ethereum simple auction contract that everyone can send their bids during a bidding period.
contract SimpleAuction {
// Parameters of the auction. Times are either
// absolute unix timestamps (seconds since 1970-01-01)
// or time periods in seconds.
address public beneficiary;
uint public auctionStart;
uint public biddingTime;
// Current state of the auction.
address public highestBidder;
@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 / introrx.md
Created February 16, 2016 15:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
#!/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'