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, | |
ExecutionContext, | |
CallHandler, | |
ClassSerializerInterceptor, | |
PlainLiteralObject, | |
} from '@nestjs/common'; | |
import { Request } from 'express'; | |
import { Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; |
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 { getJwtToken, removeJwtToken, setJwtToken } from '@/providers/auth-provider.ts'; | |
import { backendUrl } from '@/utils/config.ts'; | |
import type { JwtTokenModel } from '@/utils/models.ts'; | |
export interface FetcherResponse<TData> { | |
message: string; | |
statusCode: number; | |
data?: TData; | |
error?: string; | |
page?: number; |
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 nodemailer from 'nodemailer'; | |
import { FindOptionsWhere, IsNull, Like, Not, Repository } from 'typeorm'; | |
import { User } from '@/user/entities/user.entity'; | |
import { Notification } from '@/common/entities/notification.entity'; | |
import { InjectRepository } from '@nestjs/typeorm'; | |
import { | |
forwardRef, | |
Inject, | |
Injectable, | |
NotFoundException, |
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 must be in a top-level module as a provider (e.g. AppModule or a shared module marked as Global) | |
import { Inject, Injectable, Scope } from '@nestjs/common'; | |
import { REQUEST } from '@nestjs/core'; | |
import { Request } from 'express'; | |
import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm'; | |
import { ActiveScopeRepository } from '@/common/repositories/active-scope.repository'; | |
@Injectable({ | |
scope: Scope.REQUEST, |
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 'dart:async'; | |
import 'dart:convert'; | |
import 'package:gql_exec/gql_exec.dart'; | |
import 'package:gql_link/gql_link.dart'; | |
import 'package:dart_pusher_channels/dart_pusher_channels.dart'; | |
typedef WsEventDecoder = | |
FutureOr<Map<String, dynamic>?> Function(String eventData); |
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
<?php | |
if (! class_exists('FetchResponse')) { | |
class FetchResponse | |
{ | |
private int $status; | |
private string $body; | |
private ?string $error; | |
private array $headers; |
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
<?php | |
function async(Closure $task): Closure | |
{ | |
static $resolved = []; | |
if ( ! extension_loaded('pcntl') || ! extension_loaded('posix')) { | |
return $task; | |
} |
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
#!/bin/bash | |
set -eu | |
CLOUDFLARE_FILE_PATH=/etc/nginx/cloudflare | |
echo "# Cloudflare" > $CLOUDFLARE_FILE_PATH; | |
echo "" >> $CLOUDFLARE_FILE_PATH; |
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
#!/bin/bash | |
set -eu | |
# Get the Cloudflare IPs. | |
curl -s https://www.cloudflare.com/ips-v4 -o /tmp/cloudflare_ips | |
echo "" >> /tmp/cloudflare_ips | |
curl -s https://www.cloudflare.com/ips-v6 >> /tmp/cloudflare_ips | |
# Reset the firewall to clean stuff. |
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
<?php | |
/** | |
* Class Duration | |
* Represents a time span with microsecond precision, similar to Dart's Duration class. | |
*/ | |
class Duration | |
{ | |
/** | |
* @var int Total duration in microseconds. |
NewerOlder