You have installed GPG, then tried to perform a git commit and suddenly you see this error message after it 😰
error: gpg failed to sign the data
fatal: failed to write commit object
Understand the error (important to solve it later!)
| handleDrop = files => { | |
| // Push all the axios request promise into a single array | |
| const uploaders = files.map(file => { | |
| // Initial FormData | |
| const formData = new FormData(); | |
| formData.append("file", file); | |
| formData.append("tags", `codeinfuse, medium, gist`); | |
| formData.append("upload_preset", "pvhilzh7"); // Replace the preset name with your own | |
| formData.append("api_key", "1234567"); // Replace API key with your own Cloudinary key | |
| formData.append("timestamp", (Date.now() / 1000) | 0); |
| version: "3.5" | |
| services: | |
| mongo: | |
| image: mongo:latest | |
| container_name: mongo | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: admin | |
| MONGO_INITDB_ROOT_PASSWORD: admin | |
| ports: |
| main() { | |
| var city = "new york"; | |
| print(titleCase(city)); | |
| } | |
| /// Inefficient way of capitalizing each word in a string. | |
| String titleCase(String text) { | |
| if (text.length <= 1) return text.toUpperCase(); | |
| var words = text.split(' '); | |
| var capitalized = words.map((word) { |
| /** | |
| * Converts paths defined in tsconfig.json to the format of | |
| * moduleNameMapper in jest.config.js. | |
| * | |
| * For example, {'@alias/*': [ 'path/to/alias/*' ]} | |
| * Becomes {'@alias/(.*)': [ '<rootDir>/path/to/alias/$1' ]} | |
| * | |
| * @param {string} srcPath | |
| * @param {string} tsconfigPath | |
| */ |
| import { NextResponse } from 'next/server' | |
| import type { NextRequest } from 'next/server' | |
| export function middleware(req: NextRequest) { | |
| // get cookie token | |
| const hasToken = req.cookies.get('token') | |
| // protected routes (admin routes) | |
| if (req.nextUrl.pathname.startsWith('/admin')) { | |
| if (hasToken) { |
| //file: ./pages/api/checkHTTPMethod.ts | |
| /* this code will allow only GET method requests on this route */ | |
| import { Middleware, use } from 'next-api-route-middleware'; | |
| import type { NextApiRequest, NextApiResponse } from 'next'; | |
| export const allowMethods = (allowedMethods: string[]): Middleware => { | |
| return async function (req, res, next) { |