Skip to content

Instantly share code, notes, and snippets.

View vincentlg's full-sized avatar

Vincent Le Gallic vincentlg

View GitHub Profile
@vincentlg
vincentlg / index.js
Created February 17, 2021 21:15
Script used for revealing mystery cards from a block hash
const RNG = require('rng-js');
const COMMON = 21;
const UNCOMMON = 22;
const RARE = 23;
const MYTHIC = 24;
function shuffle(array, rng) {
let m = array.length, t, i;
pragma solidity ^0.4.18;
/*
To create a campaign on Charitychain.io, you must drop half of the goal and collect the rest by inviting your entourage to unblock your donation.
If successful, 100% of the funds are donated to the NGO.
If the objective of the campaign is not achieved, everyone is refunded.
*/
/*
Attention, important warning here!
@vincentlg
vincentlg / Auction.sol
Created October 16, 2017 16:37
Simplified Auction Smart contract
pragma solidity ^0.4.8;
// UNSAFE CODE, DO NOT USE! demo purpose
contract Auction {
enum Stages {
Initialization,
AuctionInprogress,
AuctionFailure,
AuctionSuccess
@vincentlg
vincentlg / crowdfunding.sol
Last active October 6, 2017 13:33
simplified crowdfunding solidity
pragma solidity ^0.4.8;
contract Crowdfunding {
enum Stages {
Initialization,
CampaignInprogress,
CampaignFailure,
CampaignSuccess
}
pragma solidity ^0.4.0;
contract Campaign {
enum States
{
inprogress,
success,
fail
}
@vincentlg
vincentlg / Campaign.sol
Last active March 5, 2018 22:29
Beta of Smart contract for Charitychain Campaign (State of advancement)
pragma solidity ^0.4.18;
/*
To create a campaign on Charitychain.io, you must drop half of the goal and collect the rest by inviting your entourage to unblock your donation.
If successful, 100% of the funds are donated to the NGO.
If the objective of the campaign is not achieved, everyone is refunded.
*/
/*
Attention, important warning here!
@vincentlg
vincentlg / Roulette.sol
Last active February 25, 2017 20:47 — forked from joseluu/Roulette.sol
pragma solidity ^0.4.0;
contract Roulette {
uint public lastRoundTimestamp;
uint public nextRoundTimestamp;
address _creator;
uint _interval;
@vincentlg
vincentlg / UIExemple.m
Created July 22, 2011 21:31
Simple exemple de composant Graphique en Objective C - UILabel et UIWebView
//(@implementation UIViewController)
- (void)loadView
{
UIView* myView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
myView.backgroundColor = [UIColor whiteColor];
self.view = myView;
[myView release];
//
// ClockView.m
// Clock
//
// Created by Vincent Le Gallic on 27/05/11.
// Copyright 2011 Frianbiz. All rights reserved.
//
#import "ClockView.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
window = [[UIWindow alloc] initWithFrame:[ [UIScreen mainScreen] bounds]];
[window makeKeyAndVisible];
//init du modèle
model = [ClockModel new];