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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| tea "github.com/charmbracelet/bubbletea" | |
| ) | |
| type PageNumber 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
| import axios from 'axios'; | |
| class RedditClient { | |
| constructor({ clientId, clientSecret, refreshToken, userAgent }) { | |
| this.accessTokenExpire = new Date(Date.now() - 1000); | |
| this.authToken = Buffer.from(`${clientId}:${clientSecret}`).toString('base64'); | |
| this.refreshToken = refreshToken; | |
| this.userAgent = userAgent; | |
| } |
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 { join, relative, sep } from "node:path"; | |
| import { recase } from '@kristiandupont/recase'; | |
| import kanel from 'kanel'; | |
| import kanelKysely from 'kanel-kysely'; | |
| const toCamelCase = recase('snake', 'camel'); | |
| const toPascalCase = recase('snake', 'pascal'); | |
| export function trimWhitespaceHook(path, lines, instantiatedConfig) { | |
| return lines.filter((line, index, array) => { |
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 Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; | |
| const commands = [ | |
| { | |
| name: 'foo', | |
| options: [ | |
| { name: 'foo-string', type: 'STRING', autocomplete: true }, | |
| { name: 'foo-integer', type: 'INTEGER' }, | |
| ], | |
| }, |
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 { readFile, writeFile } from "node:fs/promises"; | |
| import { normalize } from "node:path"; | |
| import { inspect } from "node:util"; | |
| import { Project } from "ts-morph"; | |
| async function tryReadFile(path) { | |
| try { | |
| return await readFile(path, { encoding: "utf-8" }); | |
| } catch { | |
| return null; |
NewerOlder