Skip to content

Instantly share code, notes, and snippets.

View mikecabana's full-sized avatar
✌️
dilly dallying

Michael Cabana mikecabana

✌️
dilly dallying
View GitHub Profile
@mikecabana
mikecabana / oidc-auth.service.ts
Last active August 8, 2018 13:58 — forked from danielcrisp/auth.service.ts
Oidc Client Authorization Service - Async HTTP Interceptors | Angular 6.x | rxjs 6.x
import { Injectable } from '@angular/core';
import { UserManager, User } from 'oidc-client';
import { Observable, from } from 'rxjs';
@Injectable({
providedin: 'root'
})
export class AuthService {
private userManager: UserManager;
@mikecabana
mikecabana / authorization-token-interceptor.service.ts
Last active January 16, 2019 09:31 — forked from danielcrisp/token.interceptor.ts
Authorization Token Interceptor Service - Async HTTP Interceptors | Angular 6.x | rxjs 6.x
import { Injectable } from '@angular/core';
import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { User } from 'oidc-client';
import { AuthService } from './oidc-auth.service.ts';
@Injectable({
providedIn: 'root'
@JanMalch
JanMalch / Angular - custom structural directives.md
Last active May 16, 2024 08:05
Writing your own structural directives with context variables

Writing your own structural directives with context variables

Complete code in math.directive.ts

After reading this you will be able to create a structural directive with inputs and context variables and use it like this:

<div *math="10; exponent: 3; let input; 
            let exponent = exponent; let r = root;
 let p = power; let ctrl = controller"&gt;
@remi
remi / shc.js
Last active March 2, 2022 14:32
Extract JSON object from https://smarthealth.cards QR code
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb
// Usage
// $ node shc.js "shc:/01234569…"
const zlib = require("zlib");