Skip to content

Instantly share code, notes, and snippets.

View Whoaa512's full-sized avatar
❤️
Love

C.J. Winslow Whoaa512

❤️
Love
View GitHub Profile
@Whoaa512
Whoaa512 / hygenTestHelpers.ts
Created November 14, 2019 21:35
Some helpers to test hygen
import fs from 'fs';
import path from 'path';
import execa from 'execa';
import { runner } from 'hygen';
import Logger from 'hygen/dist/logger';
export type ArgsObject = { [key: string]: string | boolean };
export const readFileString = (path: string) => fs.readFileSync(path, 'utf8');
@Whoaa512
Whoaa512 / SideFilterCollapsibleStates.ts
Created July 30, 2020 19:03
Example of broken no-shadow with TypeScript
export const COLLAPSED = 'collapsed';
export const EXPANDED = 'expanded';
export const COLLAPSIBLE_AND_EXPANDED = 'collapsable_and_expanded';
export enum SideFilterCollapsibleStates {
COLLAPSED = 'collapsed',
COLLAPSIBLE_AND_EXPANDED = 'collapsable_and_expanded',
EXPANDED = 'expanded',
}
@Whoaa512
Whoaa512 / chatgpt.py
Created March 11, 2023 03:31 — forked from joeddav/chatgpt.py
Simple ChatGPT
import openai
class ChatGPT:
""" A very simple wrapper around OpenAI's ChatGPT API. Makes it easy to create custom messages & chat. """
def __init__(self, model="gpt-3.5-turbo", completion_hparams=None):
self.model = model
self.completion_hparams = completion_hparams or {}
self.history = []
self._messages = []
@Whoaa512
Whoaa512 / Speed Up ⏩.js
Created September 26, 2023 06:26
Useful bookmarklets
javascript: (function () {
const vids = [
...document.querySelectorAll('video'),
...document.querySelectorAll('audio'),
...[...document.querySelectorAll('iframe').values()].flatMap(el => {
try {
return [
...el.querySelectorAll('video').values(),
...el.querySelectorAll('audio').values(),
];
from concurrent.futures import ThreadPoolExecutor, as_completed
def do_things(i, dry_run):
print(i, dry_run)
return i * 2, i * 3
def main():
build_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9]