Skip to content

Instantly share code, notes, and snippets.

@ShankarSumanth
ShankarSumanth / ng-keycloak-setup.txt
Last active April 22, 2018 04:11
angular-keycloak-tutorial
git clone https://github.com/qdouble/angular-webpack-starter.git angular-keycloak
cd angular-keycloak
npm install
npm run start:hmr
@ShankarSumanth
ShankarSumanth / Git-log-commands
Last active August 11, 2017 13:40
Git Log commands
# From https://coderwall.com/p/euwpig/a-better-git-log
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# add it to globalconfig
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# rest head
git reset --hard HEAD^
# reset head by number of commits
<div class="row">
<div class="col-xs-12">
<video #video class="video"></video>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<button md-raised-button color="primary" (click)="startRecording()"> Record </button>
<button md-raised-button color="primary"(click) ="stopRecording()"> Stop</button>
<button md-raised-button color="primary" (click)="download()"> Download</button>
yarn add recordrtc
npm install -g yarnpkg
// Login.Component.ts
// check if user is already logged in
ngOnInit() {
this.checkLoginSubscriber = this.loginService.isLoggedIn()
.subscribe(loggedIn => {
//console.log("Logged In?: " + loggedIn);
if (loggedIn) {
this.loginService.redirectToAuthorizedPage();
}
function setupCheckLoginIframe() {
var promise = createPromise();
if (!loginIframe.enable) {
promise.setSuccess();
return promise.promise;
}
if (loginIframe.iframe) {
promise.setSuccess();
kc.isLoggedIn = function () {
var promise = createPromise();
storage = new PersistentStorage();
if (!kc.responseMode) {
kc.responseMode = 'fragment';
}
if (!kc.responseType) {
kc.responseType = 'code';
kc.flow = 'standard';
}
@ShankarSumanth
ShankarSumanth / angular2-keycloak-integration(v2).js
Created February 22, 2017 01:54
Version 2 of modified keycloak Angular 2
//KeycloakService.init()
// .then(() => {
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
// })
// .catch(() => window.location.reload());
@ShankarSumanth
ShankarSumanth / Angular2-Keycloack-Integration.js
Last active February 22, 2017 01:27
Existing Angular 2 Keycloak Integartion example for Medium Article
KeycloakService.init()
.then(() => {
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
})
.catch(() => window.location.reload());