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 { NextApiRequest } from 'next' | |
import formidable from 'formidable' | |
import { promises as fs } from 'fs' | |
import path from 'path' | |
import sanitize from 'sanitize-filename' | |
import axios from 'axios' | |
import { handler } from '@Lib/api' | |
import { | |
UnauthenticatedError, | |
UnsupportedMethodError, |
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 { setContext } from '@apollo/link-context' | |
import { ApolloLink, ExecutionResult } from '@apollo/client' | |
import { authService } from '@Services' | |
export const authLinkMiddleware = setContext( | |
async (_, { headers }) => { | |
// get the authentication token from cookie storage if it exists | |
const token = await authService.getAccessToken() | |
if (!!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
const LOCAL_IPV4_REGEX = /(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/ | |
const LOCAL_IPV6_REGEX = /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/ | |
export function getClientIPAddress() { | |
let addrInfo, ifaceDetails | |
let localIPInfo: string = '' | |
//Get the network interfaces | |
const networkInterfaces = require('os').networkInterfaces() | |
//Iterate o |
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 { useQuery } from "@apollo/react-hooks"; | |
import { NetworkStatus } from "@apollo/client"; | |
import gql from "graphql-tag"; | |
import ErrorMessage from "./ErrorMessage"; | |
export const ALL_POSTS_QUERY = gql` | |
query GET_ALL_PRODUCTS_PAGES( | |
$first: Int | |
$after: String | |
$last: Int |
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
# Expires map | |
map $sent_http_content_type $expires { | |
default off; | |
text/html epoch; | |
text/css 30d; | |
application/javascript 30d; | |
~image/ max; | |
font/woff2 max; | |
font/woff max; | |
image/x-icon max; |
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
<?php | |
use GraphQL\Error\UserError; | |
use WPGraphQL\Data\UserMutation; | |
use WPGraphQL\JWT_Authentication\Auth; | |
use WPGraphQL\Model\User; | |
use WPGraphQL\Mutation\UserRegister; | |
use WPGraphQL\Types; | |
use WPGraphQL\WooCommerce\Data\Mutation\Customer_Mutation; | |
use WPGraphQL\WooCommerce\Model\Customer; |
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 java.util.*; | |
import java.text.*; | |
public class TreeMapDemo { | |
public static void main(String[] args) { | |
// creating maps | |
TreeMap<Date, String> treemap = new TreeMap<Date, String>(); | |
SortedMap<Date, String> treemaphead = new TreeMap<Date, String>(); | |
SortedMap<Date, String> treemaptail = new TreeMap<Date, 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
type Eternal = unknown; | |
type Dust<T extends any[], R> = (...args: T) => R; | |
class Sin extends Error { | |
source: InnerLife; | |
} | |
class Choices implements Sweat { | |
Labor: any[][]; | |
Toil: any[][]; |
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
/* | |
3. Program stores student response in a double precision floating-point variable | |
4. Program uses floating-point comparison to determine if the students answer is correct | |
9. Program shall display the number of correct and incorrect responses at the end of a session |