This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
const ManagementClient = require('[email protected]').ManagementClient; | |
var emailVerified = user && user.email_verified ? user.email_verified : false; | |
if (!emailVerified) { | |
var management = new ManagementClient({ | |
token: auth0.accessToken, | |
domain: auth0.domain | |
}); | |
var data = { | |
user_id: user.user_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Sign In with Auth0</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
</head> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Sign In with Auth0</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate Token | |
# https://auth0.com/docs/api/authentication#client-credentials | |
curl --request POST \ | |
--url 'https://tanver.au.auth0.com/oauth/token' \ | |
-H 'content-type: application/json' \ | |
-d '{"grant_type":"client_credentials","client_id": "[client id]","client_secret": "[client secret]","audience": "https://[domain].auth0.com/api/v2/"}' | |
#Find Connection | |
# https://auth0.com/docs/api/management/v2#!/Connections/get_connections |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var auth0 = new auth0.WebAuth({ | |
clientID: environment.auth0.client_id, | |
domain: environment.auth0.domain, | |
responseType: environment.auth0.responseType, | |
audience: environment.auth0.audience, | |
redirectUri: environment.auth0.callbackurl, | |
scope: environment.auth0.scope, | |
}); | |
const params = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Find character secuences including overlapping matches | |
s = "azcbobobegghakl" | |
p=[i for i in range(len(s)) if s.startswith('bob', i)] | |
print(p); | |
print(len(p)) | |
# Reading list | |
#Recommend Reading | |
# https://docs.python.org/3/tutorial/datastructures.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.data.getCustomer().subscribe(res => { | |
console.log(res[0]); | |
this.customerForm.patchValue({ | |
firstName: res[0].firstName, | |
lastName: res[0].lastName | |
}); | |
for (let index = 0; index < res[0].mobile.length; index++) { | |
this.mobiles.controls.push(this.buildNumber()); | |
this.mobiles.at(index).patchValue({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/of'; | |
export interface ICustomer { | |
firstName: string; | |
lastName: string; | |
mobile: IMobile[]; | |
} | |
export interface IMobile { | |
number: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mat-card> | |
<mat-card-content> | |
<form class="example-form" [formGroup]="customerForm"> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="firstName" placeholder="FirstName"> | |
</mat-form-field> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="lastName" placeholder="Last Name"> | |
</mat-form-field> |