<?php
defined('BASEPATH') or exit('No direct script access allowed');
$config = [
/*
|--------------------------------------------------------------------------
This file contains 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
using System.IdentityModel.Tokens.Jwt; | |
using System.Security.Claims; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
using Microsoft.Extensions.Caching.Distributed; | |
using Microsoft.IdentityModel.Tokens; | |
/// <summary> | |
/// Reject JWT token containing blacklisted JTI. The JTI is registered into cache provider to be blacklisted, |
This file contains 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
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16 as builder | |
ARG TARGETPLATFORM | |
ARG BUILDPLATFORM | |
ARG TARGETOS | |
ARG TARGETARCH | |
WORKDIR /app/ | |
ADD . . | |
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o yourapplication main.go |
This file contains 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, { useState } from 'react'; | |
import { StyleSheet, View, Dimensions } from 'react-native'; | |
import Animated, { | |
useSharedValue, | |
useAnimatedGestureHandler, | |
withSpring, | |
useAnimatedStyle, | |
withTiming, | |
useDerivedValue, | |
runOnJS |
This file contains 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
#QRCode geneartion made easy | |
import os | |
import pyqrcode | |
from PIL import Image | |
class QRCode(object): | |
def __init__(self,text): | |
self.qr_image = self.qr_generator(text) |
Next.js blurs the lines between client and server. It supports pre-rendering pages at build time (SSG) or request time (SSR). Prisma is the perfect companion if you need to work with a database in a Next.js app.
Here is a list of example apps that are based on Next.js and use Prisma on the server to access data from a database:
✍️ Language | 🤖 Server | 🔐 Authentication | 🔗 URL |
---|---|---|---|
TypeScript | API Routes | Yes (via NextAuth.js) | URL |
TypeScript | API Routes | No |
This file contains 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 { setIn } from 'final-form'; | |
import { useMemo } from 'react'; | |
/** | |
* Sets the `innerError.message` in an `errors` object at the key | |
* defined by `innerError.path`. | |
* @param {Object} errors The object to set the error in. | |
* @param {{ path: string, message: string }} innerError A `yup` field error. | |
* @returns {Object} The result of setting the new error message onto `errors`. | |
*/ |
This file contains 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, {useState} from "react"; | |
import axios from "axios"; | |
import config from "../config" | |
const endpoint = config.apiGateway.URL; | |
export const Upload = () => { | |
const [file, setFile] = useState<File | undefined>() |
This file contains 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
/** | |
* This was a proof of concept for me to be able to | |
* retrieve an API key using a Netlify environment variable | |
* using this lambda function. I spent a lot of time looking | |
* for a complete example like this--without any luck. | |
* | |
* So, here's a step-by-step of what I did. | |
* | |
* 1) For this function to work, define the env variable in | |
* Netlify > Site > Build & Deploy > Environment > Edit Variables |
This file contains 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 * as yup from 'yup'; | |
import { setIn } from 'final-form'; | |
const validationSchema = yup.object({ | |
email: yup.string().email(), | |
shipping: yup.object({ | |
name: yup.string(), | |
phone: yup.object({ | |
code: yup.string().matches(/^\+\d+$/i), | |
number: yup.number().max(10), |
NewerOlder