Whenever Copilot writes a script that does exactly what I was hoping it to do, I will record them here.
import fs from "fs/promises";
async function renameMovies(dir) {
import { Children, ReactNode, isValidElement, useMemo } from 'react'; | |
type ShowProps<T> = { | |
when: T; | |
fallback?: ReactNode; | |
children: ReactNode | ((item: NonNullable<T>) => ReactNode); | |
}; | |
/** | |
* Concept borrowed from Solid: https://www.solidjs.com/docs/latest/api#show |
type HttpStatus = { | |
// 2xx | |
200: 'Ok'; | |
201: 'Created'; | |
202: 'Accepted'; | |
203: 'Non-Authoritative Information'; | |
204: 'No Content'; | |
205: 'Reset Content'; | |
// 4xx | |
400: 'Bad Request'; |
#!/usr/bin/env node | |
import NextEnv from "@next/env"; | |
import axios from "axios"; | |
import chalk from "chalk"; | |
import dtsgenerator from "dtsgenerator"; | |
import fs from "node:fs/promises"; | |
import path from "node:path"; | |
import { oraPromise } from "ora"; | |
import prettier from "prettier"; |
import AppProviders from "@/components/AppProviders"; | |
import AppShell from "@/components/AppShell"; | |
import { withAuth } from "@/lib/auth0/with-auth"; | |
import { AppProps } from "next/app"; | |
import { ReactNode } from "react"; | |
interface MyAppProps extends AppProps { | |
err: Error; | |
Component: AppProps["Component"] & { | |
displayAppShell?: boolean; |
import Knex, { MySqlConnectionConfig } from "knex"; | |
import * as Snowflake from "snowflake-sdk"; | |
import { promisify } from "util"; | |
const Dialect = require("knex/lib/dialects/mysql/index.js"); | |
Dialect.prototype._driver = () => Snowflake; | |
Dialect.prototype.wrapIdentifierImpl = (value: string) => value; | |
Dialect.prototype.validateConnection = () => true; |
// Embed this as a bookmarklet using `javascript: ...` | |
(function () { | |
var script = document.createElement('script'); | |
script.src = "https://unpkg.com/turbolinks@5.2.0/dist/turbolinks.js"; | |
document.head.appendChild(script); | |
})(); |
I hereby claim:
To claim this, I am signing this object:
async function weather(key, ...args) { | |
const url = `https://api.darksky.net/forecast/${key}/` + args.join(',') | |
const config = { | |
credentials: "same-origin", | |
mode: 'no-cors', | |
method: "GET", | |
headers: { | |
'Accept': 'application/json' | |
} | |
} |
Ubuntu 14.04 | |
Drupal 7 | |
CiviCRM 4.7 |