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
{ | |
"openapi": "3.1.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "OpenAPI" | |
}, | |
"components": { | |
"schemas": {}, | |
"parameters": {} | |
}, |
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
// SPDX-License-Identifier: GPL-3.0-only | |
pragma solidity ^0.8.20; | |
import "forge-std/Vm.sol"; | |
import "forge-std/console.sol"; | |
import "forge-std/Test.sol"; | |
import {GGPVault} from "../contracts/GGPVault.sol"; | |
import {MockTokenGGP} from "./mocks/MockTokenGGP.sol"; | |
import {MockStaking} from "./mocks/MockStaking.sol"; |
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 { withAuth } from 'next-auth/middleware' | |
import { NextRequest, NextResponse } from 'next/server' | |
import { encode, getToken } from 'next-auth/jwt' | |
import { Octokit } from '@octokit/core' | |
import { GitHubAppUserAuthentication, createAppAuth } from '@octokit/auth-app' | |
import { logAndReportError } from './services/withErrorHandling' | |
import { enforceEnvVars } from 'shared-types/utils' | |
function signOut(request: NextRequest) { | |
const response = NextResponse.redirect( |
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 { StatusType } from '@aws-sdk/client-codebuild' | |
import { ImageResponse } from '@vercel/og' | |
import { NextRequest } from 'next/server' | |
export const config = { | |
runtime: 'edge', | |
} | |
type GradientGenerator = { | |
generate: (seed: string) => string |
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
type GradientGenerator = { | |
generate: (seed: string) => string | |
} | |
const colors = ['c051e9', '578ce6', '8cacf5', 'd8fb9f'] | |
// Simple PRNG using Mulberry32 algorithm | |
function mulberry32(seed: number) { | |
return function () { | |
let temp = (seed += 0x6d2b79f5) |
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
const fs = require('fs') | |
const path = require('path') | |
const jscodeshift = require('jscodeshift') | |
const updatePackageJson = function (fileInfo) { | |
const json = JSON.parse(fileInfo.source) | |
// Check if the package is using react-scripts | |
const usesReactScripts = | |
(json.dependencies && json.dependencies['react-scripts']) || |
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
const fs = require("fs"); | |
const path = require("path"); | |
const jscodeshift = require("jscodeshift"); | |
const updatePackageJson = function (fileInfo) { | |
const json = JSON.parse(fileInfo.source); | |
// Check if the package is using react-scripts | |
const usesReactScripts = | |
(json.dependencies && json.dependencies["react-scripts"]) || |
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
/* eslint-disable */ | |
const fs = require("fs/promises"); | |
const path = require('path') | |
const process = require('process') | |
const replaceRules = [ | |
// Replace all absolute paths with relative paths | |
// Replace src="/example" with src="example" and href="/example" with href="example" | |
[/ (src|href)="\/(?!\/)/g, ' $1="'], | |
// Replace url("/example") with url("example") |
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 function returns an address from an event log like a Transfer event. | |
param receipt a transaction receipt to search through | |
param topic the topic hash of the event | |
param index the topic index of the argument to return | |
*/ | |
function getAddressFromEvent( | |
receipt: ethereum.TransactionReceipt | null, | |
topic: string, | |
index: i32 |
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
// get the full transmitted data to test | |
const fullTransmission = `` | |
.split("\n") | |
.map((input) => parseInt(input)); | |
// This is the number used to generate a sliding window to use as possible inputs | |
const PREAMBLE_LENGTH = 25; | |
// Sum to the goal number using only the possible operands | |
function sumTo(goal, possibleOperands) { |