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 { createServer } from "node:http"; | |
import { parse } from "node:url"; | |
import { initGraphClient } from "@/modules/msgraph/client"; | |
import { rosterfyImportWorkflowId } from "@/modules/volunteer/workflows/rosterfyImportWorkflow"; | |
import config from "@payload-config"; | |
import next from "next"; | |
import cron from "node-cron"; | |
import { getPayload } from "payload"; | |
const port = Number.parseInt(process.env.PORT || "3010"); |
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 React from 'react'; | |
import { Modal } from '@faceless-ui/modal'; | |
import { Button } from 'payload/components'; | |
import { | |
Form, | |
FormSubmit, | |
RenderFields, | |
fieldTypes, | |
} from 'payload/components/forms'; |
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 someQuestion: CollectionConfig = { | |
slug: 'some-collection', | |
custom: { | |
cacheControl: 'public, max-age=300, stale-while-revalidate=300, stale-if-error=86400', | |
}, | |
} |
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 JobStopsListenerFieldEffect from "@/modules/transport/components/JobStopsListenerField/JobStopsListenerFieldEffect"; | |
import type { UIFieldServerComponent } from "payload"; | |
const JobStopsListenerField: UIFieldServerComponent = async ({ payload }) => { | |
const warehouse = | |
( | |
await payload.find({ | |
collection: "addresses", | |
where: { | |
type: { |
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 { Gutter } from "payload/components/elements"; | |
import { Form, FormSubmit, RenderFields, fieldTypes } from "payload/components/forms"; | |
import { DefaultTemplate } from "payload/components/templates"; | |
import { AdminViewComponent } from "payload/config"; | |
import { useStepNav } from "payload/dist/admin/components/elements/StepNav"; | |
import { Field } from "payload/types"; | |
import React, { useEffect } from "react"; | |
import { useTranslation } from "react-i18next"; | |
const PayloadFormExample: AdminViewComponent = () => { |
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 { CollectionConfig } from "payload/types"; | |
import { UploadsGridView } from "../../components/UploadsGridView/UploadsGridView"; | |
export const Media: CollectionConfig = { | |
slug: "media", | |
admin: { | |
components: { views: { List: UploadsGridView } } // Set the List view to use the Grid view, | |
}, | |
upload: { | |
staticURL: "/media", |
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 { User } from 'payload/dist/auth'; | |
import { Access, AccessArgs, FieldAccess } from 'payload/types'; | |
type CheckerArgs = { | |
user?: User; | |
id?: string | number; | |
}; | |
type Checker = (args: CheckerArgs) => boolean; | |
const isAdmin: Checker = ({ user }) => user?.role && user?.role === 'admin'; |
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 compress(string, encoding) { | |
const byteArray = new TextEncoder().encode(string); | |
const cs = new CompressionStream(encoding); | |
const writer = cs.writable.getWriter(); | |
writer.write(byteArray); | |
writer.close(); | |
return new Response(cs.readable).arrayBuffer(); | |
} | |
function decompress(byteArray, encoding) { |
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
#OS-GreymonSheet | |
#For switching to Master user | |
for user in $(cat /etc/passwd | grep master | awk -F : '{print $1}'); do su $user; done | |
#For Finding application with corresponging domain name | |
grep -lr "domain.com" */conf/* | |
#For checking apache logs of every application in Cloudways |
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
#MYSQL | |
#For login to mysql | |
mysql -h hostname -u dbusername -p dbname | |
#For taking dump of mysql | |
mysqldump -h hostname -u dbusername -p dbname > dbbackup.sql | |
#For taking dump without tablespaces | |
mysqldump -h hostname -u dbusername -p dbname --no-tablespaces > dbback.sql |
NewerOlder