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 { dirname } from 'path' | |
import { fileURLToPath } from 'url' | |
import { FlatCompat } from '@eslint/eslintrc' | |
import prettier from 'eslint-plugin-prettier' | |
import jsxA11y from 'eslint-plugin-jsx-a11y' | |
const __filename = fileURLToPath(import.meta.url) | |
const __dirname = dirname(__filename) | |
const compat = new FlatCompat({ baseDirectory: __dirname }) |
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
-- ========================================= | |
-- Create a read-only SQL Server login/user for all databases | |
-- Usage: Set @username and @password as needed | |
-- ========================================= | |
-- Step 1: Declare variables for username and password | |
DECLARE @username NVARCHAR(128) = N'USERNAME'; | |
DECLARE @password NVARCHAR(128) = N'PASSWORD'; | |
-- Step 2: Create the login at the server level (if not already created) |
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 client'; | |
import React, { createContext, JSX, useCallback, useContext, useEffect, useState } from "react"; | |
import { useLocalStorage } from "@/hooks/useLocalStorage"; | |
import { THEME, LOCALE } from "@/theme"; | |
// import type { ThemeMode, LocaleType } from '@/theme'; | |
interface ApplicationConfigsProps { | |
children: JSX.Element; | |
} |
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
# Check if script is running as Administrator | |
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
if (-not $isAdmin) { | |
Write-Error "This script must be run as Administrator. Exiting..." | |
exit 1 | |
} | |
# Step 1: Backup and remove NODE_ENV from system environment | |
$originalNodeEnv = [System.Environment]::GetEnvironmentVariable("NODE_ENV", "Machine") | |
[System.Environment]::SetEnvironmentVariable("NODE_ENV", $null, "Machine") |
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
// React and types | |
import * as React from 'react'; | |
import type { Dayjs } from 'dayjs/esm'; | |
// Dayjs and locales | |
import 'dayjs/locale/he'; | |
import 'dayjs/locale/en'; | |
// MUI X Date Pickers | |
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; |
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 { Client, LocalAuth, WAState } from "whatsapp-web.js"; | |
const _createClientInstance = (): Client => { | |
global.client = global.client?.getState() | |
? global.client | |
: new Client({ | |
authStrategy: new LocalAuth({ | |
clientId: "client", | |
}), | |
}); |
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 IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"command": "npm run start:dev", | |
"name": "Run Server", | |
"request": "launch", |
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 winston from 'winston'; | |
import asyncLocalStorage from './request-context.js'; | |
// Custom format to handle errors properly | |
const errorStackFormat = winston.format((info) => { | |
if (info instanceof Error) { | |
return Object.assign({}, info, { | |
stack: info.stack, | |
message: info.message, | |
}); |
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 IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"command": "npm run start:dev", | |
"name": "Run Server", | |
"request": "launch", |
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 puppeteer from 'puppeteer'; | |
import sharp from 'sharp'; | |
import logger from '../../services/logger.js'; | |
import PDFDocument from 'pdfkit'; | |
import { promisify } from 'util'; | |
import fs from 'fs'; | |
import { Recipe } from 'muhammara'; | |
export async function convertToPdf(url, pdfOptions = {}) { | |
const browser = await puppeteer.launch(); |
NewerOlder