This file contains 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 { HttpLink } from 'apollo-angular/http'; | |
import { ApolloLink, InMemoryCache } from '@apollo/client/core'; | |
import { setContext } from '@apollo/client/link/context'; | |
import { environment } from '@environments/environment'; | |
import { extractFiles } from 'extract-files'; | |
export function createApolloClient(httpLink: HttpLink) { | |
const uri = `${environment.backendURL}/graphql`; | |
const auth = setContext((operation, context) => { |
This file contains 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
{ | |
"attackers": [ | |
{ | |
"alliance_id": 99004804, | |
"character_id": 96780701, | |
"corporation_id": 215297637, | |
"damage_done": 1817, | |
"final_blow": true, | |
"security_status": 0.1, | |
"ship_type_id": 49710, |
This file contains 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
// You can set up the structure without creating this entity, but when the project grows, | |
// you will need the entity for leftJoin. | |
import { BaseEntity, Entity, PrimaryColumn } from 'typeorm'; | |
@Entity() | |
export class RequestUser extends BaseEntity { | |
@PrimaryColumn('uuid') | |
requestId: string; | |
@PrimaryColumn('uuid') |
This file contains 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
#!/usr/bin / env node | |
import express from 'express'; | |
import cors from 'cors'; | |
import bodyParser from 'body-parser'; | |
import '@lib/env'; | |
import { authChecker } from './auth-checker'; | |
import environmentErrorReporter from '@lib/environmentErrorReporter'; | |
import { appDataSource } from '@server/datasource'; | |
import { buildSchema } from 'type-graphql'; | |
import { resolvers } from './modules/resolvers'; |
This file contains 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
// bir sayine sonra bir değer üretir | |
const timer$ = timer(1000); | |
timer$.subscribe(value => { | |
console.log(value); // 0 | |
}); | |
// her bir saniyede bir artan değer üretir | |
const interval$ = interval(1000); | |
interval$.subscribe(value => { |
This file contains 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 bodyParser from 'body-parser'; | |
import cors from 'cors'; | |
import express from 'express'; | |
import * as fs from 'fs'; | |
import * as jwt from 'jsonwebtoken'; | |
const accessKey = fs.readFileSync('src/keys/access_token_pkcs8.key', 'utf-8'); | |
const refreshKey = fs.readFileSync('src/keys/refresh_token_pkcs8.key', 'utf-8'); | |
const app = express(); |
This file contains 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 { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpErrorResponse } from '@angular/common/http'; | |
import { Observable, BehaviorSubject } from 'rxjs'; | |
import { catchError, filter, switchMap, take } from 'rxjs/operators'; | |
import { AuthService } from '@services/auth.service'; | |
import { Router } from '@angular/router'; | |
import { TokenType } from '@app/graphql.module'; | |
@Injectable() | |
export class AuthInterceptor implements HttpInterceptor { |
This file contains 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 AccesToken keypair | |
openssl genrsa -out access_token.pem 2048 | |
openssl rsa -in access_token.pem -pubout -out access_token_publickey.crt | |
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in access_token.pem -out access_token_pkcs8.key | |
// Generate RefreshToken keypair | |
openssl genrsa -out refresh_token.pem 2048 | |
openssl rsa -in refresh_token.pem -pubout -out refresh_token_publickey.crt | |
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in refresh_token.pem -out refresh_token_pkcs8.key |
This file contains 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
<div x-data="{ | |
value: {{ value }} ?? '', | |
displayValue: {{ value }} ?? '', | |
demaskValue(value) { | |
this.value = value.replaceAll('$', '').replaceAll(',', '') | |
} | |
}" class="-mr-2"> | |
<input | |
type="text" | |
x-mask:dynamic="'$' + $money($input)" |
NewerOlder