Skip to content

Instantly share code, notes, and snippets.

View iamonuwa's full-sized avatar
💭
Learning 🦀

Onuwa Nnachi Isaac iamonuwa

💭
Learning 🦀
View GitHub Profile
0x12977be2dce14098329fb1ef5cbe93fa701d055b40fc97d5aae8b329020aecee
did:3:bafyreibtcr2qedgcngr2u6h6czcgtmupv2fh7ilgigulizaakqgvmobcce
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol';
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol';
contract ExampleToken is ERC20 {
using SafeMath for uint256;
@iamonuwa
iamonuwa / cheat_sheet.md
Created June 25, 2020 15:49 — forked from nhudinhtuan/cheat_sheet.md
15 days cheat sheet for interviews
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreicsoll2bzvd7oe4tr5ifvfthdbjc3jz33xr4z3tfsy2icfhsem7s4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@iamonuwa
iamonuwa / index.html
Last active January 31, 2020 20:45
Login with torus without npm
<html>
<head>
<title>Torus</title>
</head>
<body>
<script
src="https://app.tor.us/v0.2.12/embed.min.js"
integrity="sha384-lSiHcwUwWc+IymcuPXKXIJNrAdqA69cjnB7L8VWHlSI99WbNqzM3yLzQD/M9m2jq"
crossorigin="anonymous"
>
const tx = await arweave.createTransaction(
{ data: JSON.stringify(data) },
key
);
console.log(tx);
tx.addTag("App-Name", "demo");
tx.addTag("App-Version", "0.0.1");
tx.addTag("Unix-Time", Math.round(new Date().getTime() / 1000));
tx.addTag("Type", "publish");
@iamonuwa
iamonuwa / index.html
Created August 5, 2019 13:30
Allow Comma on input type text for numbers and disable text input
<Input
type="text"
placeholder="Enter the number"
onKeyDown={this.onKeyDown}
/>
@iamonuwa
iamonuwa / group-objects-by-property.md
Created July 31, 2019 08:05 — forked from mikaello/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Keys or Property Values

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
@iamonuwa
iamonuwa / group-objects-by-property.md
Created July 31, 2019 08:05 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;