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 / Artisan.php
Created June 7, 2016 12:57
Laravel Cheat Sheet
php artisan --help OR -h
php artisan --quiet OR -q
php artisan --version OR -V
php artisan --no-interaction OR -n
php artisan --ansi
php artisan --no-ansi
php artisan --env
// -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
php artisan --verbose
@iamonuwa
iamonuwa / app
Last active January 19, 2017 09:13
Cross Origin Request Blocked. What's wrong with thes codes???
var app = angular.module('app', ['satellizer', 'ngRoute','ui.router', 'paystack', 'chieffancypants.loadingBar','truncate', 'homeModule', 'videoModule', 'packageModule', 'eventManagerModule', 'userManagerModule', 'upload', 'event'])
app.config(function($routeProvider, $locationProvider, $authProvider, $httpProvider){
$routeProvider
.when('/home', {
templateUrl: 'partials/home.html',
controller: 'HomeCtrl'
})
.when('/pricing', {
templateUrl: 'partials/pricing.html'
@iamonuwa
iamonuwa / basic.md
Created January 25, 2017 19:33 — forked from zenorocha/basic.md
New Firebase Auth vs Old Firebase Auth
@iamonuwa
iamonuwa / countries.json
Created March 7, 2017 11:04 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@iamonuwa
iamonuwa / example.component.ts
Created November 30, 2017 17:24 — forked from ckimrie/example.component.ts
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {
@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 = {};
/******************************************************************************/
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 / 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"},
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 / 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')