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
// Use @UploadedFile() when uploading a single file/video/image | |
@Post('/upload-file') | |
@UseInterceptors(FileInterceptor('video')) | |
async createCheckedIn( | |
@UploadedFile() file: Express.Multer.File, | |
@Res() res: Response, | |
) {} | |
// use @UploadedFiles() when uploading multiple file/video/images |
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
<html> | |
<head> | |
<script src="https://cdn.socket.io/4.3.2/socket.io.min.js" | |
integrity="sha384-KAZ4DtjNhLChOB/hxXuKqhMLYvx3b5MlT55xPEiNmREKRzeEm+RVPlTnAn0ajQNs" | |
crossorigin="anonymous"></script> | |
<script> | |
const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijc3YTJhMzdhLTA2ZDMtNGUwZC05OTVlLWMyZDI0YTZhZGVjMSIsInR5cGUiOiJhdXRoIiwiaWF0IjoxNzIzMDYyMDgxLCJleHAiOjE3MjMxNDg0ODF9.F19lekTdIeumR8uVlQeuJdXjAL81Ye5G_FCWRyU335U" | |
const socket = io('http://localhost:2242', { | |
query: { token } |
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
{ | |
"data": [ | |
{ | |
"name": "9mobile 9Payment Service Bank", | |
"code": "120001" | |
}, | |
{ | |
"name": "Abbey Mortgage Bank", | |
"code": "404" | |
}, |
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
[ | |
{ | |
"id": 376, | |
"InstitutionCode": "090270", | |
"InstitutionName": "AB MICROFINANCE BANK", | |
"Category": "9", | |
"dump": null, | |
"created_at": "2020-03-02 20:44:54", | |
"updated_at": "2020-08-24 00:02:52", | |
"deleted_at": null, |
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 { DataSource } from 'typeorm'; | |
import { ConfigService } from '@nestjs/config'; | |
import { config } from 'dotenv'; | |
import models from '../../models'; | |
config(); | |
const configService = new ConfigService(); | |
export default new DataSource({ | |
type: 'postgres', |
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 { Webhook, MessageBuilder } from 'discord-webhook-node'; | |
export type IDiscord = { link?: string, title?: string, author?: string, message?: string } | |
async sendToDiscord(payload: IDiscord) { | |
// send to discord | |
const { link, title, author, message } = payload; | |
try { | |
const hook = new Webhook(link); | |
const embed = await new MessageBuilder() |
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 pandas as pd | |
# Load the data from the CSV file into a DataFrame | |
file_path = "data.csv" # Replace with the actual path to your CSV file | |
df = pd.read_csv(file_path) | |
# Get user input for the search criteria | |
search_input = input("Enter the value you want to search for: ") | |
# Filter the DataFrame based on the search criteria |
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 { SetMetadata } from '@nestjs/common'; | |
export interface SelfDecoratorParams { | |
userIDParam: string; | |
allowAdmins?: boolean; | |
} | |
export const Self = (params: SelfDecoratorParams | string) => | |
SetMetadata( | |
'selfParams', |
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 axios from "axios" | |
const COINGGECKO_BASE_URL:string = 'https://api.coingecko.com/api/v3' | |
const VS_CURRENCY: string = "usd" | |
const CURRENCY_IDS:string = "bitcoin,ethereum,ripple,stellar,celo" | |
const ORDER:string = "market_cap_desc" | |
const PERPAGE:number = 100 | |
const PAGE = 1 | |
const SPARKLINE:boolean = false |
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, Logger } from "@nestjs/common"; | |
import axios from "axios"; | |
import { IHttpServices } from "src/core/abstracts/http-services.abstract"; | |
@Injectable() | |
export class AxiosService implements IHttpServices { | |
async get(url: string, config: Record<string, any>) { | |
try { | |
const response = await axios.get(url, config) |