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
| name: 🚀 Deploy File to cPanel | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| FTP-Deploy-Action: | |
| name: 🎉 Deploy | |
| runs-on: ubuntu-latest |
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
| db.collection.aggregate([ | |
| { | |
| "$facet": { | |
| "caseByTitle": [ | |
| { | |
| "$match": { | |
| "caseTitle": { | |
| "$regex": ".*godrej.*", | |
| "$options": "i" | |
| } |
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
| const { UAParser } = require("ua-parser-js") | |
| const ipLocator = require('ip-locator') | |
| const parser = new UAParser(req.headers['user-agent']); | |
| const result = parser.getResult() | |
| const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress | |
| ipLocator.getDomainOrIPDetails(ip, "json", function (err, ipInfo) { | |
| res.json({ result, ipInfo }) | |
| }); |
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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-l | |
| RewriteRule . /index.html [L] | |
| </IfModule> |
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
| const { Checkout } = require('checkout-sdk-node') | |
| require("dotenv").config() | |
| const cko = new Checkout(process.env.CHECKOUT_SECRET_KEY, { pk: process.env.CHECKOUT_PUBLIC_KEY }); | |
| module.exports = makeAPayment = async (token, addressLine1, addressLine2, city, state, zip, amount, country="PK", phone, currency, paymentType, reference, description, customerEmail, customerName) => { | |
| const countryCode = phone.slice(0,3) | |
| const phoneNumber = phone.slice(3,-1) | |
| const payment = await cko.payments.request({ | |
| source: { | |
| token: token, // Generated by Checkout.Frames |
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
| const { S3Client } = require('@aws-sdk/client-s3'); | |
| const AWS = require('aws-sdk'); | |
| const multer = require('multer') | |
| const multerS3 = require('multer-s3') | |
| const ep = new AWS.Endpoint('s3.wasabisys.com'); | |
| const { generateString } = require("./index") | |
| const s3 = new S3Client({ | |
| endpoint: ep, |
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
| export const getPrograms = () => { | |
| const degrees = [ | |
| "Matriculation in Science", | |
| "Matriculation in Computer Science", | |
| "Intermediate Pre Engineering", | |
| "Intermediate Medical", | |
| "Intermediate Computer Science", | |
| "Intermediate Arts", | |
| "Intermediate Commerce", | |
| "Associate Degree in Accounting Finance", |
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
| const s3 = new AWS.S3({ | |
| accessKeyId: process.env.AWS_ACCESS_KEY, | |
| secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | |
| }); | |
| const uploadFile = () => { | |
| fs.readFile(file.filepath, (err, data) => { | |
| if (err) { | |
| res.status(400).send(ApiResponse({}, err.message, 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
| function getDayNames(from, to) { | |
| var d = new Date(from), | |
| to = new Date(to), | |
| a = [], | |
| y = [ | |
| "Sunday", | |
| "Monday", | |
| "Tuesday", | |
| "Wednesday", | |
| "Thursday", |
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
| const a = [1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1] | |
| let count = 0 | |
| let _count = [] | |
| a.forEach((item, index)=> { | |
| if(item==1){ | |
| count = count + 1 | |
| if(index==a.length-1) _count.push(count) | |
| } | |
| else{ |