Skip to content

Instantly share code, notes, and snippets.

View Whoaa512's full-sized avatar
❤️
Love

C.J. Winslow Whoaa512

❤️
Love
View GitHub Profile
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]
@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(),
];
@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 / 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 / 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 / Stacked-diff-steps.md
Last active September 28, 2023 08:05
Cheatsheet for the stacked diffs workflow in phabricator at Fictiv

stack diff steps

  1. Checkout & pull latest master
git checkout master && git pull --rebase origin master
  1. Cut branch from master
arc branch stacked_feature_1
  1. Make changes, add commits
@Whoaa512
Whoaa512 / MetricTypeDef.js
Created April 5, 2018 14:21
Example of GraphQL files for highlighting
const MetricTypeDefs = `
# Primitive types for conveying geometric data
type Metric {
count: Int!
}
# The input for sendMetrics
input MetricInput {
name: String!
points: [Float!]!
@Whoaa512
Whoaa512 / test.js
Last active August 17, 2017 23:57 — forked from adnanoner/upsert.js
Knex postgres upsert
// Run with jest
import knex from 'knex'
import knexPgUpsert from '../knexPgUpsert'
const db = knex({ client: 'pg' })
const taps = [
{
@Whoaa512
Whoaa512 / startup.sh
Created August 26, 2016 15:53
Kia's aws startup script
#!/usr/bin/env bash
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Update the package manager's listings
echo "Updating the package manager's listings"
@Whoaa512
Whoaa512 / gulfile.js
Created October 15, 2015 04:01
Gulpfile for simple elm project
var concat = require('gulp-concat')
var concatCss = require('gulp-concat-css')
var csso = require('gulp-csso')
var del = require('del')
var elmBins = require('elm')
var glob = require('glob')
var gulp = require('gulp')
var jade = require('gulp-jade')
var jadeConcat = require('gulp-jade-template-concat')
var simpleSpawner = require('simple-spawner')