Skip to content

Instantly share code, notes, and snippets.

View agrcrobles's full-sized avatar

Zetta Flow agrcrobles

  • Barcelona
View GitHub Profile
@agrcrobles
agrcrobles / README.md
Created October 29, 2018 11:16
express simple server

Simple Server in Express

  1. Fix the route when necessary

  2. Run

npm init
yarn add express
node index.js
@agrcrobles
agrcrobles / aspnetcore.development.dockerfile
Last active August 18, 2018 04:52
aspnetcore.dockerfile
FROM microsoft/dotnet:sdk
LABEL author="Dan Wahlin"
ENV DOTNET_USE_POLLING_FILE_WATCHER=1
ENV ASPNETCORE_URLS=http://*:5000
EXPOSE 5000
import Contract from 'truffle-contract';
import VotingArtifact from '../build/contracts/Voting.json';
import Web3 from 'web3';
function Star(candidate) {
const Voting = Contract(VotingArtifact);
var web3Provided;
@agrcrobles
agrcrobles / 1_initial_migration.js
Created January 29, 2018 16:28
Deploy voting contract
var Migrations = artifacts.require('./Migrations.sol');
module.exports = function(deployer) {
deployer.deploy(Migrations, { gas: 4612388 });
};
@agrcrobles
agrcrobles / package.json
Created January 22, 2018 07:20 — forked from pelle/package.json
Uport Connect - React Native example
{
"name": "exampleapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node_modules/react-native/packager/packager.sh --nonPersistent",
"test": "jest",
"build-uport-connect": "node_modules/.bin/derequire node_modules/uport-connect/dist/uport-connect.js >src/vendor/uport-connect.js"
},
"dependencies": {
@agrcrobles
agrcrobles / Web3HookedWalletEthTxSubprovider.js
Created January 19, 2018 20:49
Create HookedWalletEthTx Subprovider for web3 to make it work on web
import Web3 from 'web3';
const ProviderEngine = require('web3-provider-engine');
const Web3Subprovider = require('web3-provider-engine/subproviders/web3.js');
const HookedWalletEthTxSubprovider = require('web3-provider-engine/subproviders/hooked-wallet-ethtx.js');
const PUBLIC_ACCOUNT = '0xPUBLIC_ACCOUNT_HERE';
$(".new-goods-submit-button").on('click',function(){
console.log('submitting goood');
//get hash of the good
var file_unique_hash = $("#good_file_input").data('uniquehash');
var file_name = "canoe";
var file_description = "a wooden boat";
@agrcrobles
agrcrobles / .eslintrc.js
Last active December 22, 2017 05:16
My eslintrc favourite configuration! :)
module.exports = {
parser: require.resolve("babel-eslint"),
env: {
es6: true
},
parserOptions: {
sourceType: "module",
ecmaFeatures: {
import React, { Component } from 'react'
/**
* Creates a component class that renders the given Material UI component
*
* @param MaterialUIComponent The material ui component to render
* @param mapProps A mapping of props provided by redux-form to the props the Material UI
* component needs
*/
export default function createComponent(MaterialUIComponent, mapProps) {
@agrcrobles
agrcrobles / README.md
Created December 7, 2017 21:56 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe