Skip to content

Instantly share code, notes, and snippets.

View iamonuwa's full-sized avatar
💭
Learning 🦀

Onuwa Nnachi Isaac iamonuwa

💭
Learning 🦀
View GitHub Profile
@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,
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: {

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:

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);
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}
@iamonuwa
iamonuwa / buildSitemap.js
Created June 25, 2018 21:57 — forked from evantahler/buildSitemap.js
35 lines to build a sitemap for next.js projects
#! /usr/bin/env node
// I am ./bin/buildSitemap.js
const path = require('path')
const glob = require('glob')
const fs = require('fs')
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')
import { AfterViewInit, Directive, ElementRef, EventEmitter, forwardRef, Inject, Injectable, InjectionToken, Injector, Input, NgZone, OnInit, Output } from '@angular/core';
import { AbstractControl, ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, NgControl, Validators } from '@angular/forms';
import { Http } from '@angular/http';
declare const grecaptcha : any;
declare global {
interface Window {
grecaptcha : any;
reCaptchaLoad : () => void
@iamonuwa
iamonuwa / Carddetection.js
Created April 10, 2018 15:09 — forked from swapnilmishra/Carddetection.js
Javascript function to detect type of debit/credit card
function getCardType(cardNum) {
if(!luhnCheck(cardNum)){
return "";
}
var payCardType = "";
var regexMap = [
{regEx: /^4[0-9]{5}/ig,cardType: "VISA"},
{regEx: /^5[1-5][0-9]{4}/ig,cardType: "MASTERCARD"},
{regEx: /^3[47][0-9]{3}/ig,cardType: "AMEX"},
var multer = require('multer'),
fs = require('fs'),
path = require('path'),
axios = require('axios'),
nodemailer = require('nodemailer'),
etherVerify = require('./config/utils'),
onfido = require('onfido'),
defaultClient = onfido.ApiClient.instance,
cloudinary = require('cloudinary'),
@iamonuwa
iamonuwa / api-provider.js
Created December 20, 2017 09:16 — forked from jelbourn/api-provider.js
Example of using an angular provider to build an api service. Subject of August 20th 2013 talk at the NYC AngularJS Meetup. http://www.meetup.com/AngularJS-NYC/events/134578452/See in jsbin: http://jsbin.com/iWUlANe/5/editSlides: https://docs.google.com/presentation/d/1RMbddKB7warqbPOlluC7kP0y16kbWqGzcAAP6TYchdw
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (@jelbourn)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/