Skip to content

Instantly share code, notes, and snippets.

View tonycoco's full-sized avatar

Tony Coconate tonycoco

View GitHub Profile
@tonycoco
tonycoco / bookmarket.js
Last active April 22, 2021 16:58
Safari Bookmarklet for <video> AirPlay options – Copy the `bookmarket.js` snippet and paste it as the address of a bookmark in Safari. Then, while playing any <video> you can click the bookmarklet and the <video> will bring up your AirPlay options.
javascript:if(window.WebKitPlaybackTargetAvailabilityEvent){var videos=document.getElementsByTagName("video");if(videos.length>0)for(var airplayable=videos[0],i=0;i<videos.length;i++)if(!(airplayable=videos[i]).paused){airplayable.webkitShowPlaybackTargetPicker();break}}
@tonycoco
tonycoco / auth.py
Last active March 8, 2022 16:27
Google Display & Video 360 Simple Auth
import google.auth
import googleapiclient.discovery
API_NAME = "displayvideo"
API_SCOPES = ["https://www.googleapis.com/auth/display-video"]
API_VERSION = "v1"
credentials, project = google.auth.default(scopes=API_SCOPES)
print(f"Google Cloud Project ID: {project}.")
@tonycoco
tonycoco / Code.js
Last active November 3, 2022 17:59
=GPT3() for Google Sheets (Google Apps Script)
// Useage: =GPT3(prompt)
// Example: =GPT3("This bot will generate a creative ad headline that is will increase views, clicks, and impressions, based on a website category.\n\nWebsite Category: tech\nHeadline: Why Google will win the AI wars\n\nWebsite Category: retail\nHeadline: Need a break? Check out our new fall selections now!\n\nWebsite Category: pharma\nHeadline: Are you ready for the next pandemic? Be prepared with your own pandemic survival kit today\n\nWebsite Category: travel\nHeadline: We noticed that cruise lines are super cheap now, find out why!\n\nWebsite Category: holiday\nHeadline: Partying for the holidays? Find a new coat to go out in!\n\nWebsite Category: sports\nHeadline:")
class OpenAIApp {
static get API_KEY_PROP() {
return "OPENAI_API_KEY";
}
constructor(apiKey) {
this.apiKey = apiKey;
@tonycoco
tonycoco / jit.md
Last active April 18, 2025 21:17
Enable JIT on iOS and tvOS from the command line
@tonycoco
tonycoco / keymap.sh
Created January 15, 2025 21:18
macOS Sequoia Window Tiling Keymap similar to Rectangle.app
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Fill' '~^\U21A9' # Window > Fill: ^ + ⌥ + ↩
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Center' '~^c' # Window > Center: ^ + ⌥ + c
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Left' '~^\UF702' # Window > Move & Resize > Left: ^ + ⌥ + ←
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Right' '~^\UF703' # Window > Move & Resize > Right: ^ + ⌥ + →
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Top' '~^\UF700' # Window > Move & Resize > Top: ^ + ⌥ + ↑
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Bottom' '~^\UF701' # Window > Move & Resize > Bottom: ^ + ⌥ + ↓
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Bottom Left' '~^j' # Window > Move & Resize > Bottom Left: ^ + ⌥ + j
defaults write -g NSUserKeyEquivalents -dict-add '\033Window\033Move & Resize\033Bottom Rig