Skip to content

Instantly share code, notes, and snippets.

View trevor-atlas's full-sized avatar
👾
Variety is the spice of life, or something

Trevor Atlas trevor-atlas

👾
Variety is the spice of life, or something
View GitHub Profile
// Name: tiktok-images
// Description: Resize images to fit TikTok's 9:16 aspect ratio and avoid being covered by the UI
// Author: Trevor Atlas
// Twitter: @trevoratlas
// Threads: trevor.atlas
import "@johnlindquist/kit"
const sharp = await npm('sharp');
const { getAverageColor } = await npm('fast-average-color-node');
// Menu: De-Acronym-ify
// Description: Replace acronyms with their full names
// Author: Trevor Atlas
// Twitter: @trevoratlas
// Shortcut: cmd ctrl opt shift a
// Group: work
import '@johnlindquist/kit';
let text = '';
// Name: humanlike typing
// Description: Type the contents of your clipboard as if you were a human
// Author: Trevor Atlas
// Twitter: @trevoratlas
import "@johnlindquist/kit"
await hide();
await applescript(String.raw`
// Name: vpn
// Schedule: */15 * * * *
import "@johnlindquist/kit"
applescript(`
tell application "System Events" to tell process "GlobalProtect"
set connectionStatus to get help of every menu bar item of menu bar 2
if item 1 of connectionStatus = "Not Connected" then
click menu bar item 1 of menu bar 2 -- Activates the GlobalProtect "window" in the menubar
// Name: force paste
// Description: Paste the contents of your clipboard, even in fields that wouldn't let you paste
// Author: Trevor Atlas
// Twitter: @trevoratlas
// test it out on the email field here: https://codepen.io/andersschmidt/pen/kOOMmw
import "@johnlindquist/kit"
await hide();
await applescript(`tell application "System Events" to keystroke the clipboard as text`);
// Menu: Icebreaker
// Description: Get a random icebreaker question
// Author: Trevor Atlas
// Twitter: @trevoratlas
import '@johnlindquist/kit';
const dbvalues = await db('icebreakers');
const icebreakers: string[] = dbvalues.data;
// Menu: Icebreaker
// Description: Get a random icebreaker question
// Author: Trevor Atlas
// Twitter: @trevor-atlas
import '@johnlindquist/kit';
const dbvalues = await db('icebreakers');
const icebreakers: string[] = dbvalues.data;
// Menu: Icebreaker
// Description: Get a random icebreaker question
// Author: Trevor Atlas
// Twitter: @trevor-atlas
import '@johnlindquist/kit';
const dbvalues = await db('icebreakers');
const icebreakers: string[] = dbvalues.data;
@trevor-atlas
trevor-atlas / types.ts
Last active February 16, 2024 23:59
types
export type None = null | undefined;
export type Nullable<T> = T | None;
/** Make all of T's properties nullable*/
export type NullableOfType<T> = {
[P in keyof T]: Nullable<T[P]>;
};
/** Correct type for Object.entries(myobj) */
@trevor-atlas
trevor-atlas / createStore.ts
Last active October 26, 2022 06:04
contextless data store with react 18
import { useSyncExternalStore } from 'react';
export function createStore<Store>(
creator: (
set: (setter: (store: Store) => Store) => void,
get: () => Store
) => Store
) {
let store = {} as Store;
const get = () => store;