Skip to content

Instantly share code, notes, and snippets.

View BboyAkers's full-sized avatar

Austin Akers BboyAkers

View GitHub Profile
@BboyAkers
BboyAkers / scripts.js
Created November 18, 2021 01:21
Show's how to connect a button to MetaMask
window.addEventListener('DOMContentLoaded', () => {
// Get the button element id 'connect-to-metamask-button'
const connectToMetaMaskButton = document.getElementById('connect-to-metamask-button');
// This is where you'll have the account address stored
let account;
connectToMetaMaskButton.addEventListener('click', () => {
//Will Start the metamask extension to request access to the user's account(s)
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
@BboyAkers
BboyAkers / index.js
Last active January 17, 2021 09:55
pokeapi
const baseURL = 'https://pokeapi.co/api/v2/'
const getPokemon = () => {
fetch(`${baseURL}pokemon?limit=151`)
.then(response => response.json())
.then(data => {
console.log(data)
}
);
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": true
"printWidth": 100
}
@BboyAkers
BboyAkers / fixes.md
Last active July 2, 2020 20:06
MetaMask.io minor fixes

Change the "Developers" hyperlink on the navigation bar.

Suggestion: Wrap each image in the "Your key to blockchain applications" with a hyperlink to each individual website Reason: I wanted to immediately visit one of the websites but I figured out I'd have to google the website and visit it. This would make the UX more pleasant in this section in my opinion.

Urls:

@BboyAkers
BboyAkers / Getting Started With the Bluetooth API.md
Created June 10, 2020 04:10
Getting Started With the Bluetooth API

Getting Started with the Bluetooth API

@BboyAkers
BboyAkers / Getting Started with the Beacon API.md
Last active June 10, 2020 03:56
Getting Started With The Beacon API

Getting Started With The Beacon API

The Beacon API is a web API avalible for developers to implement into their application. View full list of web APIs here. The Beacon API is a Web API useful for:

  • Analytics
  • Diagnostics

Why not fetch or XMLHttpRequest?

@BboyAkers
BboyAkers / What is Tree Shaking.md
Last active May 21, 2020 15:58
What is Tree Shaking?

What is Tree Shaking?

Tree shaking is a term used as a means to eliminate code that isn't in use, or dead-code, as we call it. You can also think of it like choosing 3-4 relevant quotes from a book to write an excellent paper. If you only need 3-4 relevant quotes, why use the entire book?

Whenever a code bundler, like webpack, builds our web application for production. It does tree shaking. Code bundlers like webpack do their best to remove dead code, or unused code, to reduce the bundle size of your application when you prepare your code to be able to be used for production. Unfortunately it can't catch everything, and that because we sometimes write code that isn't tree shaking friendlfy.

A way for us to help code bundlers with tree shaking, or eliminating dead code, in our web development projects is to only import necessary methods and components into our application. We do this by using JavaScript [destructuring

@BboyAkers
BboyAkers / WhatisaCLI.md
Last active May 5, 2020 22:11
What is a CLI?

What is a CLI?

A CLI or Command Line Interface Interface is an in interface that accepts text input to execute operating system functions. As a software developer we use CLI's all the time. What exactly does a CLI look like? Open your terminal on Mac or command prompt(powershell works too) if you are on Windows. As a developer we use the terminal and/or command prompt to:

  • install packages
  • run scripts
  • manage project files

and more. Something you might be familiar with in the web development world is this

What is a CLI?

A CLI or Command Line Interface Interface is an in interface that accepts text input to execute operating system functions. As a software developer we use CLI's all the time. What exactly does a CLI look like? Open your terminal on Mac or command prompt(powershell works too) if you are on Windows. As a developer we use the terminal and/or command prompt to:

  • install packages
  • run scripts
  • manage project files

and more. Something you might be familiar with in the web development world is this

npm install 
@BboyAkers
BboyAkers / contract.js
Created April 9, 2020 00:24
new contract
/*global ethereum, MetamaskOnboarding */
/*
The `piggybankContract` is compiled from:
pragma solidity ^0.4.0;
contract PiggyBank {
uint private balance;
address public owner;