View: https://www.youtube.com/watch?v=t-hZa1mPPN0
map: any;
directionsService = new google.maps.DirectionsService();| /** | |
| * Laravel encrypt and decrypt for JavaScript, you can use on nextjs, express, etc | |
| * author: manunoly => Manuel Almaguer | |
| * used on frame project on lib/laravel-encrypt.js | |
| * based on: https://gist.github.com/huzemin/e8d7a904cec55d4d7635c9322f143c42 | |
| * How to use in PHP: | |
| * use Illuminate\Support\Facades\Crypt; | |
| * $tokenEncrypt = Crypt::encryptString($token); | |
| * $encryptedData = "eyJpdiI6ImFHRWRtbEEydTkwQmFZd2xFQ1pPbmc9PSIsInZhbHVlIjoicVcrdlkxNVlDaTFIY28zN3RLT0wxZz09IiwibWFjIjoiMjU1MWNhODkwMzc1MTk0ZTZkYjA2YmE5ZmU5N2Y4NjIxYTRjNGI3YjA4ZDBjZGJlODg0YmRlNTEwNzQ1ZDY1NiJ9"; | |
| * $message = Crypt::decrypt($encryptedData, false); |
| 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"; |
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Http\Controllers\BaseController; | |
| use App\Models\User; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Auth; | |
| class AuthController extends BaseController |
| import { AuthService } from './../servicios/auth.service'; | |
| import { environment } from './../../environments/environment.prod'; | |
| import { finalize } from 'rxjs/operators'; | |
| import { Chooser } from '@ionic-native/chooser/ngx'; | |
| import { File, FileEntry } from '@ionic-native/file/ngx'; | |
| import { UtilService } from './../servicios/util.service'; | |
| import { FilePath } from '@ionic-native/file-path/ngx'; | |
| import { WebView } from '@ionic-native/ionic-webview/ngx'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import { Injectable } from '@angular/core'; |
| import { AuthService } from './../servicios/auth.service'; | |
| import { environment } from './../../environments/environment.prod'; | |
| import { finalize } from 'rxjs/operators'; | |
| import { Chooser } from '@ionic-native/chooser/ngx'; | |
| import { File, FileEntry } from '@ionic-native/file/ngx'; | |
| import { UtilService } from './../servicios/util.service'; | |
| import { FilePath } from '@ionic-native/file-path/ngx'; | |
| import { WebView } from '@ionic-native/ionic-webview/ngx'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import { Injectable } from '@angular/core'; |
| 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), |