Skip to content

Instantly share code, notes, and snippets.

View johnfkneafsey's full-sized avatar

John F Kneafsey johnfkneafsey

View GitHub Profile
@johnfkneafsey
johnfkneafsey / MetaMask Information
Created March 21, 2017 23:22
MetaMask Information
CONNECTING TO GETH
In the console:
geth --networkid 3 --port "35555" --datadir "/Users/johnfkneafsey/Library/Ethereum/testnet" console
ACCOUNTS
Account Addresses:
John (Main Account): 0xA7feBB8C2baaC3F4B4bc7d6C38c55507d917b1d3
John 2:
John 3:
Token Contract Address:
0xa3f5f88cf2156c94f3b0a831a45afb6685eab2df
Token Contract Transaction Hash:
0x1a4ec9a31edcf6bde90a0a72731ce04870383b5878515a5f4dba5dba46679ef8
Token Balance:
token.coinBalanceOf(eth.accounts[0]) + " tokens"
EVENT LISTENER: Send token:
@johnfkneafsey
johnfkneafsey / web3 Ethereum Capstone Notes
Created March 17, 2017 23:11
web3 Ethereum Capstone Notes
Account Management API Calls:
Login/Unlock Account
web3.personal.unlockAccount("yourAddress", "password")
Miscellaneous API Calls:
Send Ether
web3.eth.sendTransaction({from:"fromAddress", to:"toAddress", value: web3.toWei('integer', 'ether')})
CONNECTING TO GETH
In the console:
geth --networkid 3 --port "35555" --datadir "/Users/johnfkneafsey/Library/Ethereum/testnet" console
ACCOUNTS
Account Addresses:
John (Main Account): 0x9aE6C8795c4158C73d5B7303Ae39ed0a248f86cB
John 2: 0xce651572Bd6CF08084b1ffAAFB1884C0ac9e672c
John 3: 0xF6133E0611C27b99aba8bFA4E1f95b3E78Dbb5E4
[ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "proposals", "outputs": [ { "name": "recipient", "type": "address", "value": "0xf6133e0611c27b99aba8bfa4e1f95b3e78dbb5e4" }, { "name": "amount", "type": "uint256", "value": "2" }, { "name": "description", "type": "string", "value": "Really dank dapp idea" }, { "name": "votingDeadline", "type": "uint256", "value": "1489685502" }, { "name": "executed", "type": "bool", "value": false }, { "name": "proposalPassed", "type": "bool", "value": false }, { "name": "numberOfVotes", "type": "uint256", "value": "2" }, { "name": "currentResult", "type": "int256", "value": "2" }, { "name": "proposalHash", "type": "bytes32", "value": "0xf404df0dcd21fbbfc5d06045bd3cdf2d6e444791a58ad8c97f994cb5f2b61279" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "targetMember", "type": "address" } ], "name": "removeMember", "outputs": [], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "
// define version
pragma solidity ^0.4.2;
// defines the "owned" contract
contract owned {
// defines the "variable" as an "address" and makes it public *** Need more info on public vs non public
address public owner;
// defines the owner of the contract as the sender *** The original sender? Any sender? It's not obvious here but I think I know the answer.
I strongly urge you to oppose the nomination of Betsy DeVos to be secretary of education. DeVos has neither the qualifications nor the experience to serve as the nation’s secretary of education, and her record clearly demonstrates that, if confirmed, she will undermine and seek to privatize public education.
I am committed to protecting and expanding a public education system that reinforces our country’s promise of economic opportunity, democratic values rooted in pluralism, and equality; that nurtures children in a safe learning environment that is adequately supported, not defunded or privatized; and that includes public higher education that is affordable and inclusive and promotes free inquiry.
In a recent poll conducted by Hart Research Associates, American voters said they believe we need a secretary of education whose priority is strengthening and improving all public schools (78 percent) rather than someone whose priority is helping parents send their children to private and nontraditional public
1.) What is shallow rendering and why is it useful for testing React?
Shallow rendering is useful when testing in React because it allows to you ensure that you are testing a single component individually and not its children components.
2.) What aspects of a React Component can you test using shallow rendering?
-type
-props (src, alt, etc.)
-user events
-responses to user events
3.) Which features of a component should you test?
1.) How do you pass information from a child component to its parent in React?
Through callback functions.
2.) What do we mean when we talk about container components?
Container components are top level components that handle data fetching and render sub-components.
3.) What roles should the container component play?
See above
1) How do you define a stateless component in React?
A component that does not contain state - all information is passed to it from a parent function.
2) How do you define a stateful component?
A component that contains state - an object that can be stored as part of the component and updated by the component itself.
3) How would you access and modify the state in a stateful component?
State is accessed and modified through the this.state command.
4) What is the difference between state and props?