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
#!/bin/bash | |
# This script | |
# - takes in a file name from the command line | |
# - reads the file contents | |
# - requests from the OpenAI GPT-3 API | |
# - gets the text of the first suggestion using jq (jq '.choices[0].text' -r) | |
# - appends the first suggestion to the file | |
# Usage: ./gpt.sh <file> |
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 { useRouter } from 'next/router' | |
import { useCallback, useEffect, useState } from 'react' | |
/** | |
* A hook that easily lets you add a route change trap. | |
* @param shouldTrap Whether or not to trap the route change. | |
* @returns An object with the following properties: | |
* - `isTrapped`: Whether or not the route change is currently trapped. | |
* - `leavePage`: A function that will leave the page. | |
* - `stayOnPage`: A function that will stay on the page. |
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 uniswapV3PoolABI = [ | |
{ | |
inputs: [], | |
name: 'slot0', | |
outputs: [ | |
{ internalType: 'uint160', name: 'sqrtPriceX96', type: 'uint160' }, | |
{ internalType: 'int24', name: 'tick', type: 'int24' }, | |
{ internalType: 'uint16', name: 'observationIndex', type: 'uint16' }, | |
{ | |
internalType: 'uint16', |
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 GameKit | |
public class SeededGenerator: RandomNumberGenerator { | |
public let seed: UInt64 | |
private let generator: GKMersenneTwisterRandomSource | |
public convenience init() { | |
self.init(seed: 0) | |
} |
OlderNewer