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
| // Importing the getSortedPostsData function from the specified module | |
| import { getSortedPostsData } from "@/app/lib/posts"; | |
| // Default function that retrieves and processes data to get dates, counts, and date ranges | |
| export default function GetDates() { | |
| // Get the sorted post data using the imported function | |
| const data = getSortedPostsData(); | |
| // Object to store the count of posts for each month | |
| const monthCount: { [key: string]: 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 { MetadataRoute } from "next"; | |
| export default function manifest(): MetadataRoute.Manifest { | |
| return { | |
| name: "Your Website Name", | |
| short_name: "ShortName", | |
| dir: "auto", | |
| description: "This is your website description.", | |
| categories: ["test", "sample", "webapp", "pwa"], | |
| theme_color: "#000000", |
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
| // Method to rename and move files | |
| private void RenameFiles() | |
| { | |
| // Get the parent folder of the selected folder | |
| string parentFolder = Path.GetDirectoryName(selectedFolderPath); | |
| // Create a new folder for the renamed files | |
| string newFolderPath = Path.Combine(parentFolder, "RenamedFiles"); | |
| // Check if the new folder doesn't exist, and if not, create it |
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 { cookies } from "next/headers"; | |
| import { verifyJwtToken } from "./verify-jwt-token"; | |
| // Create an async function called verifyAuth | |
| export default async function verifyAuth() { | |
| // Get the auth cookie | |
| const cookieStore = cookies(); | |
| const auth = cookieStore.get("auth"); | |
| // If no auth cookie is found, return 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
| "use client"; | |
| import { Provider } from "react-redux"; | |
| import reduxStore from "@/lib/redux/store"; | |
| export function Providers({ children }: { children: React.ReactNode }) { | |
| return <Provider store={reduxStore}>{children}</Provider>; | |
| } |
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 { useRouter } from "next/navigation"; | |
| import { useEffect } from "react"; | |
| import Loading from "@/app/loading"; | |
| type RedirectProps = { | |
| searchParams: { url: string }; | |
| }; | |
| export default function Redirect({ searchParams }: RedirectProps) { |
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
Show hidden characters
| { | |
| "extends": [ | |
| "next", | |
| "next/core-web-vitals", | |
| "eslint:recommended" | |
| ] | |
| } |
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
| interface Author { | |
| name: string; | |
| url: string; | |
| } | |
| interface Language { | |
| "@type": string; | |
| name: string; | |
| } |
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 to generate a random color in hexadecimal format | |
| export const getRandomColor = () => { | |
| // Hexadecimal characters used for color representation | |
| const letters = "0123456789ABCDEF"; | |
| // Initialize the color variable with the '#' symbol | |
| let color = "#"; | |
| // Loop to generate a random 6-digit hexadecimal color code | |
| for (let i = 0; i < 6; 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
| import React, { createContext, ReactNode, useEffect, useState } from "react"; | |
| import { GitHubRepo } from "@/types"; | |
| import { sortByDateDesc } from "@/utils/utils"; | |
| // Define the shape of the context data | |
| interface GithubContextProps { | |
| repos: GitHubRepo[] | null; | |
| gists: GitHubRepo[] | null; | |
| loading: boolean; | |
| } |