Skip to content

Instantly share code, notes, and snippets.

View ryancharris's full-sized avatar
👋

Ryan Harris ryancharris

👋
View GitHub Profile
@ryancharris
ryancharris / Base64.sol
Created January 23, 2022 00:22
Solidity Base64 utilities
pragma solidity >=0.8.0 <0.9.0;
// SPDX-License-Identifier: MIT
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <brecht@loopring.org>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@ryancharris
ryancharris / NFTixBooth.sol
Created January 23, 2022 00:22
Final smart contract from my Egghead NFT course
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "hardhat/console.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./Base64.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
const faunadb = require("faunadb");
const q = faunadb.query;
// Instantiate client
const client = new faunadb.Client({
secret: FAUNA_KEY,
domain: "localhost",
scheme: "http",
port: 8443
});
@ryancharris
ryancharris / check-prs.sh
Created May 5, 2020 16:05
EH: Lesson One
function get_pr_status() {
gh pr status
}
for dir in ~/Code/*/; do
cd $dir
get_pr_status
done
@ryancharris
ryancharris / ex-1-applying-refs.js
Last active September 8, 2019 14:00
LogRocket: Context and refs
// Applying a ref directly to an HTML element
<input
className="AuthorFilterMenu__filter-input"
ref={authorFilterInputRef}
placeholder="Filter by author..."
value={filterInputValue}
type="search"
onInput={event => {
setFilterInputValue(event.currentTarget.value);
}}
@ryancharris
ryancharris / ex-eight-toggle-template.vue
Last active May 30, 2019 01:00
LogRocket: React vs. Vue
<template>
<div class="toggle">
<ToggleButton
@clicked="workClicked"
:class="{'toggle__button': true, 'active': workActive}"
text="Work"
/>
<ToggleButton
@clicked="homeClicked"
:class="{'toggle__button': true, 'active': homeActive}"
@ryancharris
ryancharris / .block
Created January 7, 2019 16:54 — forked from mbostock/.block
Voronoi Arc Map
license: gpl-3.0
height: 600
@ryancharris
ryancharris / .vimrc
Created May 11, 2018 22:15
Vim Config
" Plugins
" -------
" nerdtree
" vim-airline
" vim-multiple-cursors
" vim-sensible
" Start Pathogen
" --------------