This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const oembedSchema = z.discriminatedUnion('type', [ | |
z.object({ | |
type: z.literal('photo'), | |
url: z.string(), | |
width: z.number(), | |
height: z.number(), | |
}), | |
z.object({ | |
type: z.literal('video'), | |
html: z.string(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The main method here is processTailwindSrcsetSizes. You can generate a sizes attribute using it based on | |
tailwind style breakpointed sizes referencing your screens, such as: | |
"100vw md:500px" | |
"200px lg:100vw" | |
"200px md:300px xl:600px" | |
"100vw lg:50vw" | |
"100vw" | |
"400px" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Tailwind Check | |
// Author: Josh Davenport-Smith | |
// Twitter: @joshdprts | |
import "@johnlindquist/kit"; | |
const b = await npm("beautify"); | |
const input = await arg({ | |
name: "Enter Tailwind classes", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Pause Any Music | |
// Description: Pause music playing from music apps | |
// Author: Josh Davenport-Smith | |
// Twitter: @joshdprts | |
import "@johnlindquist/kit"; | |
const pauseScript = ` | |
tell application "Spotify" | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Preview CSS Color | |
// Description: Preview any CSS color accepted by background-color | |
// Author: Josh Davenport-Smith | |
// Twitter: @joshdprts | |
import "@johnlindquist/kit"; | |
const color = await arg("Color"); | |
await div(` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "@joshdavenport/my-awesome-scriptkit-widget", | |
"version": "1.0.0", | |
"author": "Josh Davenport-Smith <josh@joshdavenport.co.uk>", | |
"dependencies": { | |
"some-package-my-widget-needs": "^1.0.0" | |
} | |
"scriptkit": { | |
"name": "My Awesome Widget", | |
"description": "This is my awesome widget! Check it out.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Bandcamp Album Player | |
// Description: Stream a bandcamp album | |
// Author: Josh Davenport-Smith | |
// Twitter: @jdprts | |
import "@johnlindquist/kit"; | |
import { WidgetAPI } from "@johnlindquist/kit/types/pro"; | |
const jsdom = await npm('jsdom'); | |
const INITIAL_PLAYER_WIDTH = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // -------- FOR METABOX FIELD TYPE `single_image` -------- ?> | |
<?php if($image = TGHPSite()->metabox->getSingleMetafieldValue('image')): ?> | |
<div class="intro__image"> | |
<img src="<?= wp_get_attachment_image_url($image['ID'], 'original') ?>" | |
srcset="<?= | |
TGHPSite()->asset->getAttachmentSizesSrcset( | |
$image['ID'], | |
['xxs-uncropped','xs-uncropped','s-uncropped','m-uncropped','l-uncropped','xl-uncropped','xxl-uncropped','xxxl-uncropped','xxxxl-uncropped'] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: BBC Sounds Player | |
// Description: Stream a radio station from BBC Sounds | |
// Author: Josh Davenport-Smith | |
// Twitter: @jdprts | |
import "@johnlindquist/kit"; | |
import { WidgetAPI } from "@johnlindquist/kit/types/pro"; | |
const PLAYER_WIDTH = 180; | |
const PLAYER_HEIGHT = 195; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: NTS Live | |
// Description: Stream NTS Live Channel 1 or 2 | |
// Author: Vogelino, extended by Josh Davenport-Smith | |
// Twitter: @soyvogelino, @jdprts | |
import "@johnlindquist/kit"; | |
const PLAYER_HEIGHT = 76; | |
const PLAYER_WIDTH = 205; |
NewerOlder