View: https://www.youtube.com/watch?v=t-hZa1mPPN0
map: any;
directionsService = new google.maps.DirectionsService();| import NextAuth from "next-auth" | |
| import Providers from "next-auth/providers" | |
| import { addSeconds } from "date-fns" | |
| import type { User } from "hooks/useUser" | |
| import log from "utils/server-logger" | |
| import sessionsDB, { InactiveSessionReason } from "lib/session-db" | |
| import jwtDecode from "jwt-decode" | |
| /** @see https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens#payload-claims */ | |
| export interface IDToken { |
| $.ajax({ | |
| url: "http://api.yoursite.com", | |
| data: data, | |
| type: "POST" | |
| }).done(function(result) { | |
| var link = document.createElement("a"); | |
| document.body.appendChild(link); | |
| link.setAttribute("type", "hidden"); | |
| link.href = "data:text/plain;base64," + result; | |
| link.download = "data.zip"; |
| import { Injectable } from '@angular/core'; | |
| import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; | |
| import { Observable } from 'rxjs'; | |
| @Injectable() | |
| export class AuthInterceptor implements HttpInterceptor { | |
| constructor() { } | |
| intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
View: https://www.youtube.com/watch?v=t-hZa1mPPN0
map: any;
directionsService = new google.maps.DirectionsService();Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.
| <?php | |
| $url = 'http://server.com/path'; | |
| $data = array('key1' => 'value1', 'key2' => 'value2'); | |
| // use key 'http' even if you send the request to https://... | |
| $options = array( | |
| 'http' => array( | |
| 'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
| 'method' => 'POST', | |
| 'content' => http_build_query($data), |
| import {Directive, Attribute} from '@angular/core'; | |
| import {NgModel} from '@angular/common'; | |
| @Directive({ | |
| selector: '[mask]', | |
| host: { | |
| '(keyup)': 'onInputChange()' | |
| } | |
| }) | |
| export class Mask { | |
| maskPattern: string; |