Skip to content

Instantly share code, notes, and snippets.

View kamescg's full-sized avatar
🏗️
Ethereum Applications

Kames Geraghty kamescg

🏗️
Ethereum Applications
View GitHub Profile
@kamescg
kamescg / codefund-api.js
Last active January 4, 2020 16:13
codefund-api
import {useEffect, useState, useReducer} from 'react';
const dataFetchReducer = (state, action) => {
switch (action.type) {
case 'FETCH_INIT':
return {
...state,
isLoading: true,
isError: false
};
@kamescg
kamescg / archetypes.md
Created February 20, 2020 06:30
Ethereum Archetypes Draft

Ethereum Archetypes Draft

Protocol Engineer

An Ethereum Protocol Engineer focuses on building secure and maintainable Smart Contracts.

Applicable Skills

Code: Solidity, Vyper, Rust Applications: Embark, Truffle, Ganache, Besu, Geth

@kamescg
kamescg / .jsx
Created March 28, 2020 16:56
React Hook Boilerplates
/**
* @function useTemplate
* @param {Object} props
* @version 0.0.0
* @description
*/
/* --- Global --- */
import { useEffect } from "react";
@kamescg
kamescg / .js
Created March 30, 2020 04:31
useContractSendTransaction.js
/**
* @function useContractSendTransaction
*/
/* --- Global --- */
import { useEffect, useReducer } from "react";
import { selectors } from "@ethers-react/system";
/* --- Module --- */
import withEthers from "../withContext";
@kamescg
kamescg / .js
Created April 12, 2020 18:37
React Component Validation/Rendering
export function isClassComponent(component) {
return (
typeof component === 'export function' &&
!!component.prototype.isReactComponent
) ? true : false
}
export function isInlineFunctionComponent(component) {
return (
typeof component === 'function' &&
@kamescg
kamescg / .md
Created April 23, 2020 15:44
Gatsby Information & Resources
@kamescg
kamescg / .md
Created April 25, 2020 15:32
Cheatsheets
@kamescg
kamescg / .md
Created April 27, 2020 17:42
Docker Cheatsheet

Docker Cheatsheet

Cleanup

$ docker images -aq -f 'dangling=true' | xargs docker rmi

docker volume ls -q -f 'dangling=true' | xargs docker volume rm

@kamescg
kamescg / .sol
Created May 19, 2020 15:59
Encode openLockETHAndDraw MakerDAO method
function openLockETHAndDraw(
address manager,
address jug,
address ethJoin,
address daiJoin,
bytes32 ilk,
uint wadD
) public pure returns (bytes memory) {
return abi.encodeWithSignature("openLockETHAndDraw(address,address,address,address,bytes32,uint256)", manager, jug, ethJoin, daiJoin, ilk, wadD);
}