Skip to content

Instantly share code, notes, and snippets.

View iamonuwa's full-sized avatar
💭
Learning 🦀

Onuwa Nnachi Isaac iamonuwa

💭
Learning 🦀
View GitHub Profile
import { Form, Icon, Select, Popover } from 'antd';
import React from 'react';
import { getExchangeObj } from './ExchangeSources';
const FormItem = Form.Item;
const { Option, OptGroup } = Select;
const Hint = props => (
<Popover
content={props.hint}
import { Button, Card, Col, Form, List, Row } from 'antd';
import React, { Component } from 'react';
import Loader from '../Loader';
import Field from './FindContractField';
import FindContractSuccess from './FindContractSuccess';
class FindContractForm extends Component {
constructor(props) {
super(props);

Keybase proof

I hereby claim:

  • I am iamonuwa on github.
  • I am iamonuwa (https://keybase.io/iamonuwa) on keybase.
  • I have a public key ASAIThzMZxVJ1hCqaAE4QoVZJeYcvJJjzUOYigYJZEWMmQo

To claim this, I am signing this object:

var request = require('request');
var username = sails.config.secrets.MAILCHIMP_USERNAME;
var password = sails.config.secrets.MAILCHIMP_PASSWORD;
var list = sails.config.secrets.MAILCHIMP_LIST;
module.exports = {
index: (req, res) => {
request.post(`https://us18.api.mailchimp.com/3.0/lists/${list}/members/`, {
auth: {
@iamonuwa
iamonuwa / benchmark.rs
Created March 13, 2019 15:22
Benchmark
pub fn read_file_data(path: &PathBuf) -> Vec<u8> {
let mut data = Vec::new();
let mut f = File::open(path).ok().unwrap();
f.read_to_end(&mut data).unwrap();
data
}
const VALIDATOR_CONFIG: Option<ValidatingParserConfig> = Some(ValidatingParserConfig {
operator_config: OperatorValidatorConfig {
enable_threads: true,
@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;
@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 / 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}
/>
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
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"
>