Skip to content

Instantly share code, notes, and snippets.

WΞB3 nicovalencia

Block or report user

Report or block nicovalencia

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
@nicovalencia
nicovalencia / react-hooks-example.js
Last active Mar 4, 2019
React hooks todo example
View react-hooks-example.js
import React, { useState, useContext } from 'react';
const DataContext = React.createContext();
const DataProvider = (props) => {
const [items, setItems] = useState([
"Thing 1",
"Thing 2",
"Thing 3",
View react-hoc-context-example.js
import React from 'react';
const DataContext = React.createContext();
class DataProvider extends React.Component {
state = {
items: [
"Thing 1",
"Thing 2",
"Thing 3",
View _banner.scss
img {
position: absolute;
top: 80px;
right: -74px;
@include bp(sm) {
position: relative;
width: 100%;
right: 0;
top: 0;
View Verifying my Peepeth
Verifying my identity on Peepeth.com 0x99b9bb23d300dda4a1dc9eb8d2333704b235c165
View AuctionableWorldCupPlayerTokenTest.js
it('should require Auction to be ended', async () => {
let playerId = getNextCommonPlayerId();
await instance.createCommonAuction.sendTransaction(playerId, fakeTokenURI);
let auctionsCount = (await instance.totalAuctionsCount()).toNumber();
let lastAuctionIndex = auctionsCount - 1;
// Start auction:
await instance.incrementBid.sendTransaction(lastAuctionIndex, { value: web3.toWei(0.01, 'ether'), from: accounts[1] });
try {
View AuctionBrokerInterface.sol
mapping (uint256 => Auction) auctionsByTokenId
struct Auction {
address highestBidder
uint256 highestBidAmount
uint256 endsAtBlock
uint256 tokenId
}
uint256 constant INITIAL_BID = 0.01 eth
uint256 constant MIN_BID_INCREMENT = 0.01 eth
uint256 constant EXPIRED_TOKEN_COST = 0.05 eth
View indexingService.js
const Web3 = require('web3');
const fetch = require('node-fetch');
const ipfsAPI = require('ipfs-api');
const ipfs = ipfsAPI('localhost', '5002');
const POLLING_INTERVAL = 5000;
const EVENTS = {
Transfer: {}
};
View index.js
const Web3 = require('web3');
const fetch = require('node-fetch');
const POLLING_INTERVAL = 5000;
const EVENTS = {
Transfer: {}
};
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
View InputList.js
import React from 'react';
class InputList extends React.Component {
constructor({ items }) {
super({ items });
this.state = { items };
}
render() {
View pseudo.js
// ctrl
() => {
this.dataObj = new supergloo.pager('connected_users');
}
// html
You can’t perform that action at this time.