Skip to content

Instantly share code, notes, and snippets.

View alx-andru's full-sized avatar
👨‍💻
code, deploy, repeat

Alex alx-andru

👨‍💻
code, deploy, repeat
View GitHub Profile
@alx-andru
alx-andru / Blank snippet - 6.yaml
Created February 15, 2018 23:46
Shared with Script Lab
name: Blank snippet - 6
description: ''
author: alx-andru
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
@alx-andru
alx-andru / Selection Changed.yaml
Created February 15, 2018 23:46
Add and remove an event handler on the selection changed event - Shared with Script Lab
name: Selection Changed
description: Add and remove an event handler on the selection changed event
author: alx-andru
host: EXCEL
api_set: {}
script:
content: |
$("#add-event-handler").click(addEventHandler);
$("#remove-last-event-handler").click(removeLastEventHandler);
$("#remove-all-event-handlers").click(removeAllEventHandlers);
@alx-andru
alx-andru / Selection Changed.yaml
Created February 16, 2018 00:07
Add and remove an event handler on the selection changed event - Shared with Script Lab
name: Selection Changed
description: Add and remove an event handler on the selection changed event
author: alx-andru
host: EXCEL
api_set: {}
script:
content: |
$("#add-event-handler").click(addEventHandler);
$("#remove-last-event-handler").click(removeLastEventHandler);
$("#remove-all-event-handlers").click(removeAllEventHandlers);
@alx-andru
alx-andru / app.module.ts
Last active November 4, 2018 01:27
ng-oidc-client add dependencies to AppModule
...
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,
StoreModule.forRoot({}),
EffectsModule.forRoot([]),
NgOidcClientModule.forRoot({
@alx-andru
alx-andru / callback.html
Last active October 30, 2018 13:08
Example callback.html to be used with ng-oidc-client
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Callback</title>
<link rel="icon"
type="image/x-icon"
href="favicon.png">
<script src="oidc-client.min.js"
@alx-andru
alx-andru / renew-callback.html
Last active October 26, 2018 14:06
Example renew-callback.html to be used with ng-oidc-client
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Renew Callback</title>
<link rel="icon"
type="image/x-icon"
href="favicon.png">
</head>
@alx-andru
alx-andru / signout-callback.html
Last active October 26, 2018 14:06
Example signout-callback.html to be used with ng-oidc-client
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Signout Callback</title>
<link rel="icon"
type="image/x-icon"
href="favicon.png">
<script src="oidc-client.min.js"
@alx-andru
alx-andru / angular.json
Created October 25, 2018 14:01
Modified assets of an angular.json to serve static folder and oidc-client from node_modules
...
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "src/static",
"output": "/"
},
{
@alx-andru
alx-andru / app.component.ts
Last active November 4, 2018 01:31
Minimalistic login redirect with ng-oidc-client
...
export class AppComponent implements OnInit {
title = 'DraftApp';
identity$: Observable<User>;
constructor(private oidcFacade: OidcFacade) {
this.identity$ = this.oidcFacade.identity$;
}
ngOnInit() {
@alx-andru
alx-andru / app.component.html
Created October 26, 2018 13:56
Minimalistic example to signin and signout using ng-oidc-client
<div (click)="signinRedirect()">
Signin Redirect
</div>
<pre>{{identity$ | async | json}}</pre>
<div (click)="signoutRedirect()">
Signout
</div>
<router-outlet></router-outlet>