Skip to content

Instantly share code, notes, and snippets.

View gwmccubbin's full-sized avatar
🤢
choking on candy

Gregory McCubbin gwmccubbin

🤢
choking on candy
View GitHub Profile
@gwmccubbin
gwmccubbin / understanding_gas.txt
Created February 16, 2018 16:24
🔥 Understanding Gas on Ethereum - How it works!
_____/\\\\\\\\\\\\_____/\\\\\\\\\________/\\\\\\\\\\\___
___/\\\//////////____/\\\\\\\\\\\\\____/\\\/////////\\\_
__/\\\______________/\\\/////////\\\__\//\\\______\///__
_\/\\\____/\\\\\\\_\/\\\_______\/\\\___\////\\\_________
_\/\\\___\/////\\\_\/\\\\\\\\\\\\\\\______\////\\\______
_\/\\\_______\/\\\_\/\\\/////////\\\_________\////\\\___
_\/\\\_______\/\\\_\/\\\_______\/\\\__/\\\______\//\\\__
_\//\\\\\\\\\\\\/__\/\\\_______\/\\\_\///\\\\\\\\\\\/___
__\////////////____\///________\///____\///////////_____
@gwmccubbin
gwmccubbin / quiknode_explorer.html
Last active April 3, 2018 16:26
Build a Blockchain Explorer with Quiknode.io | Ethereum dApp Tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>QuikNode Explorer</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Styles -->
@gwmccubbin
gwmccubbin / DappToken.sol
Created March 4, 2020 16:31
DApp ERC-20 Token
pragma solidity ^0.5.0;
contract Token {
string public name = "DApp Token";
string public symbol = "DAPP";
uint256 public totalSupply = 1000000000000000000000000; // 1 million tokens
uint8 public decimals = 18;
event Transfer(
address indexed _from,
➜ test-folder n
installed : v10.5.0 (with npm 6.1.0)
➜ test-folder create-react-app -V
3.3.1
➜ test-folder npm install --global create-react-app@3.3.1
npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
/usr/local/bin/create-react-app -> /usr/local/lib/node_modules/create-react-app/index.js
+ create-react-app@3.3.1
updated 7 packages in 3.571s
➜ test-folder create-react-app blockchain-developer-bootcamp
@gwmccubbin
gwmccubbin / MyContract.sol
Created March 23, 2020 17:16
Master Solidity Pt 2: Variables, Data Types, Structs
pragma solidity ^0.6.0;
contract MyContract {
string public myString = "Hello, world!";
bytes32 public myBytes32 = "Hello, world!";
int public myInt = 1;
uint public myUint = 1;
uint256 public myUint256 = 1;
uint8 public myUint8 = 1;
address public myAddress = 0x5A0b54D5dc17e0AadC383d2db43B0a0D3E029c4c;
pragma solidity ^0.6.0;
contract MyContract {
// Arrays
uint[] public uintArray = [1,2,3];
string[] public stringArray = ['apple', 'banana', 'carrot'];
string[] public values;
uint[][] public array2D = [ [1,2,3], [4,5,6] ];
pragma solidity ^0.6.0;
contract MyContract {
// Arrays
uint[] public uintArray = [1,2,3];
string[] public stringArray = ['apple', 'banana', 'carrot'];
string[] public values;
uint[][] public array2D = [ [1,2,3], [4,5,6] ];
pragma solidity ^0.6.0;
contract MyContract {
// Mappings
mapping(uint => string) public names;
mapping(uint => Book) public books;
mapping(address => mapping(uint => Book)) public myBooks;
struct Book {
string title;
pragma solidity ^0.6.0;
contract MyContract {
uint[] public numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
address public owner;
constructor() public {
owner = msg.sender;
}
pragma solidity ^0.6.0;
contract HotelRoom {
enum Statuses { Vacant, Occupied }
Statuses currentStatus;
address payable public owner;
event Occupy(address _occupant, uint _value);