Skip to content

Instantly share code, notes, and snippets.

zkkmin / auth.service.ts
Created Oct 10, 2018
Auth service with JWT token
View auth.service.ts
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import * as moment from 'moment';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json'})
zkkmin / dashboard.component.html
Created Oct 8, 2018
Fabulous dashboard content
View dashboard.component.html
<h1 class="has-text-centered is-size-1">This is your dashboard, sugar!</h1>
<div class="level">
<div class="level-item">
<img src="">
zkkmin / app.component.ts
Created Jun 30, 2018
Calling child component's function from parent view
View app.component.ts
import { Component, ViewChild } from '@angular/core';
import { RandomQuoteComponent } from './random-quote/random-quote.component'
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
export class AppComponent {
View random-quote.component.ts
import { Component, OnInit } from '@angular/core';
import { QuoteService } from '../quote.service';
selector: 'app-random-quote',
templateUrl: './random-quote.component.html',
styleUrls: ['./random-quote.component.css']
export class RandomQuoteComponent implements OnInit {
View quote.service.ts
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
providedIn: 'root'
export class QuoteService {
private quoteUrl = "";
View app.component.html
<!--The content below is only a placeholder and can be replaced.-->
<section class="hero is-info is-fullheight is-bold ">
<div class="hero-head">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">
View footer.component.html
View header.component.html
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item">
<img src="">
from threading import Thread
class APIThread(Thread)
def __init__(self, data): = data
def run(self)
# call external api
zkkmin / routes.kml
Created Jun 22, 2017
Sample KML file for barrier-free routes with source and destination postal codes pairs as route identification.
View routes.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
<Style id="redLinePoly">