Create a Shortcut with two steps:
- select photos
- get contents from url
- set method to
post - set request body to
form - use
magic variableto set file as result of last step
| router.post('/sms', async (req, res) => { | |
| const twiml = new MessagingResponse(); | |
| await workflow(`${req.body.Body}`) | |
| res.writeHead(200, {'Content-Type': 'text/xml'}); | |
| res.end('Message Received'); | |
| }); |
| [ | |
| { | |
| code: 'if (str.length > 1) {\n' + | |
| ' return str[0] + str[str.length - 1];\n' + | |
| ' }', | |
| start: 238, | |
| end: 316, | |
| charLength: 78, | |
| type: 'conditional', | |
| startLine: 8, |
| import db from '../../../utils/db'; | |
| export default async function handler (req, res) { | |
| const { id } = req.query; | |
| try { | |
| if (req.method === 'PUT') { | |
| await db.collection('my_collection').doc(id).update({ | |
| ...req.body, | |
| updated: new Date().toISOString(), |
| /** | |
| This code is taking the input text and sending it to OpenAI's API. | |
| The response from the API is then parsed into a JSON object, which contains an array of embeddings for each sentence in the input. | |
| */ | |
| createEmbeddings = async (input: string[]): Promise<EmbeddingsResponse|null> => { | |
| try { | |
| input = input.map(inp => inp.replace(/\n/g, ' ')) | |
| const body = { input }; | |
| const response = await axios.post(this.endpoint, JSON.stringify(body), |
| /** | |
| Usage: | |
| <TweetHref slug="{url}">This will be the Tweet</TweetHref> | |
| */ | |
| import styled from 'styled-components'; | |
| // create a styled component called StyledA | |
| // that is styled like an anchor tag | |
| // with the font family of Work Sans |
| /* eslint-disable react-hooks/exhaustive-deps */ | |
| import anime from 'animejs'; | |
| import { useEffect } from 'react'; | |
| import styles from './KingdomHearts.module.css' | |
| export default function KingdomHearts () { | |
| let startBGMusic | |
| let openUrl | |
| let play |
Create a Shortcut with two steps:
postformmagic variable to set file as result of last step| open -n -b "com.microsoft.VSCode" --args "$*" |
| import useSWR from "swr"; | |
| const fetcher = (...args) => | |
| fetch(...args) | |
| .then((res) => res.json()) | |
| export default function Page() { | |
| const { data, error } = useSWR("/api/endpoint", fetcher); | |
| if (!data) |
| export default async function handler(req, res) { | |
| try { | |
| const res = await longDataFetch(); | |
| return res.status(200).json(res); | |
| } catch (err) { | |
| return res.status(500).json({ error: err.message }); | |
| } | |
| } |