$ touch /usr/share/applications/robomongo.desktop
$ vim /usr/share/applications/robomongo.desktop
function check(numbers:number[], value: number): number[] { | |
const needMap:any = {}; | |
const result: number[] = []; | |
let round = 0; | |
numbers.every((n, index) => { | |
round ++; | |
if(needMap[n] > -1) { | |
result.push(...[numbers[needMap[n]], n]); |
This document copied from https://gist.github.com/abdallahokasha/37911a64ad289487387e2d1a144604ae
here.
wget
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowViewAccountInfo", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetAccountPasswordPolicy", | |
"iam:GetAccountSummary", | |
"iam:ListVirtualMFADevices", |
import { Observable, Subject, from, throwError } from 'rxjs'; | |
import { map, catchError, tap, switchMap } from 'rxjs/operators'; | |
import { Injectable } from '@angular/core'; | |
import { HttpClient, HttpErrorResponse } from '@angular/common/http'; | |
import { AuthService } from 'ngx-auth'; | |
import { TokenStorage } from './token-storage.service'; | |
import { UtilsService } from '../services/utils.service'; | |
import { AccessData } from './access-data'; | |
import { Credential } from './credential'; |
// src/app/services/token-interceptor.service.ts | |
import { Injectable } from "@angular/core"; | |
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from "@angular/common/http"; | |
import { AuthenticationService } from "../authentication.service"; | |
import { Observable } from "rxjs/Observable"; | |
import { BehaviorSubject } from "rxjs/BehaviorSubject"; | |
@Injectable() | |
export class RefreshTokenInterceptor implements HttpInterceptor { |
license: mit |
import { Request, Response } from "express"; | |
import { successResponse } from "../../Helpers/Responses/successResponse"; | |
import { ApiConfig } from "../../Configs/Api.Config"; | |
import { errorResponse } from "../../Helpers/Responses"; | |
const { OAuth2Client } = require("google-auth-library"); | |
const { google } = require("googleapis"); | |
export default async function googleLogin(request: Request, response: Response) { | |
console.log(ApiConfig.THIRD_PARTY_LOGIN_API.GOOGLE.SCOPES); |
Lua is a dynamically typed language. There are no type definitions in the language. All values carry their own type. All values in Lua are first-class values. This means that all values can be stored in variables, passed as arguments to other functions, and returned as results
There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table.
The type table implements associative arrays, that is, arrays that can be indexed not only with numbers, but with any value (except nil). Tables can be heterogeneous; that is, they can contain values of all types (except nil).
single linke comment start with --
The main defference between observable and promises is:
1. observer can emit multiple value, but promise only can work with single value. when promise `reject` or `resolve` they end.
2. promise is **eager** but observer are **lazy**
3. Promise are not cancelable but observable are cancelable
4. Promises are always asynchronous but obervable are possibly asnychronous.
5. Promise are always multicast but Observable are both multicase and unicast
example: