Skip to content

Instantly share code, notes, and snippets.

View theoomoregbee's full-sized avatar
👀

Theophilus Omoregbee theoomoregbee

👀
View GitHub Profile
@theoomoregbee
theoomoregbee / app.routes.ts
Last active July 29, 2018 13:56
app routes for route guard post
import { Routes } from '@angular/router';
import { LoginComponent } from './login/login.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
export const APP_ROUTES: Routes = [
{ path: 'login', component: LoginComponent },
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent }
];
@theoomoregbee
theoomoregbee / chartjs-utils.ts
Last active March 21, 2018 02:06
Angular, Typescript with ChartJs
// npm install chartjs --save
import * as Chart from 'chart.js';
// npm install chart.piecelabel.js --save
import 'chart.piecelabel.js';
/**
* this is simply used to init our chartjs
*
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { IData } from '../interfaces/idata';
@Component({
selector: 'app-records',
templateUrl: './records.component.html',
styles: []
})
export class RecordsComponent implements OnInit {
import { Injectable } from '@angular/core';
import { IData } from '../interfaces/idata';
import { ActivatedRouteSnapshot, RouterStateSnapshot, Resolve } from '@angular/router';
import { MockHttpService } from '../services/mock-http.service';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/forkJoin';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
@theoomoregbee
theoomoregbee / app.routes.ts
Last active March 14, 2018 01:11
Angular resolver
import { Routes } from '@angular/router';
import { RecordsComponent } from './records/records.component';
import { HomeComponent } from './home/home.component';
export const APP_ROUTES: Routes = [
{ path: 'home', component: HomeComponent },
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'records/:with-error', component: RecordsComponent},
{ path: '**', redirectTo: 'home' }
];
@theoomoregbee
theoomoregbee / .gitlab-ci.yml
Last active September 29, 2020 16:20
Gitlab Final Script for Deploying Your App over SSH
image: trion/ng-cli-karma
cache:
paths:
- node_modules/
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
deploy_stage:
@theoomoregbee
theoomoregbee / .gitlab-ci.yml
Created January 21, 2018 13:26
gitlab ci/cd angular build process
image: trion/ng-cli-karma
cache:
paths:
- node_modules/
deploy_stage:
stage: deploy
environment: Staging
only:
@theoomoregbee
theoomoregbee / server.php
Last active October 13, 2017 08:04
This is our regular traditional way of updating counter
<?php
class Trad
{
public $id;
public $count;
}
/**
* Created by PhpStorm.
@theoomoregbee
theoomoregbee / algorithm.js
Created October 4, 2017 22:48
function to return true if the string can be broken down to incrementing sets of integers
/**
* Write a function to return true if the string can be broken down to incrementing sets of integers
* no negative >= 1
* "" => false
* "1" > false
* "1315" => ? => false
* "54" => false
* "1234" => "1" + "2" + "3" + "4" => true
* "91011" => "9" + "10" + "11" => true
* "5556" => "55" + "56" => true
@theoomoregbee
theoomoregbee / app.component.ts
Created September 24, 2017 09:21
HTTPClient Interceptor Testing
import {Component} from '@angular/core';
import {SlimLoadingBarService} from 'ng2-slim-loading-bar';
import {HttpClient} from "@angular/common/http";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {