Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is
Maybe you're a vibe coder, or you're a seasoned vet who's frustrated with Next and server components. Either way, I'll show you how to set up continuous deployment for a TanStack Start application to Cloudflare Workers using GitHub Actions (securely, of course).
Assumption:
- You have a TanStack Start project initialized.
- Package manager like
pnpmornpm
Prereqs:
This file contains hidden or 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
| (function (win, doc) { | |
| 'use strict'; | |
| if (!doc.querySelectorAll || !win.Intl || !win.Intl.RelativeTimeFormat) { | |
| // doesn't cut the mustard. | |
| return; | |
| } | |
| var rtf = new Intl.RelativeTimeFormat('en', { | |
| localeMatcher: 'best fit', | |
| numeric: 'always', | |
| style: 'long' |
This file contains hidden or 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
| import { DB as SqliteDB } from "https://deno.land/x/sqlite/mod.ts" | |
| import { MongoClient } from "https://deno.land/x/mongo@v0.22.0/mod.ts" | |
| const sqlite_db = new SqliteDB("out.db") | |
| sqlite_db.query('drop table if exists posts') | |
| sqlite_db.query("CREATE TABLE posts (id INTEGER PRIMARY KEY AUTOINCREMENT, message TEXT)") | |
| const client = new MongoClient() | |
| await client.connect("mongodb://localhost:27017") | |
| const mongo_db = client.database("my-db") |
This file contains hidden or 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
| #!/bin/bash | |
| set -eu | |
| set -x | |
| docker build -t deno-cent7 . |
This file contains hidden or 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
| // $ npm install -g google-spreadsheet | |
| const { GoogleSpreadsheet } = require('google-spreadsheet') | |
| const API_KEY = '<YOUR-SUPER-SECRET-API-KEY>' // See: https://developers.google.com/sheets/api/guides/authorizing#APIKey | |
| const SHEET_ID = '<target-sheet-id>' // spreadsheet key is the long id in the sheets URL | |
| const doc = new GoogleSpreadsheet(SHEET_ID) | |
| doc.useApiKey(API_KEY) |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # | |
| # Authors: | |
| # Stefan Buck (https://github.com/stefanbuck) | |
| # Thomas Ruoff (https://github.com/tomru) | |
| # | |
| # | |
| # Description: | |
| # Are you still prefixing your commits with a ticket number manually? You will love this script! | |
| # This is a git hook script that will automatically prefix your commit messages with a ticket |
This file contains hidden or 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
| 1) Install cloudflared using homebrew: | |
| brew install cloudflare/cloudflare/cloudflared | |
| 2) Create /usr/local/etc/cloudflared/config.yaml, with the following content | |
| proxy-dns: true | |
| proxy-dns-upstream: | |
| - https://1.1.1.1/dns-query | |
| - https://1.0.0.1/dns-query |
This file contains hidden or 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
| #!/bin/bash | |
| dirty=`git status --porcelain -uno | sed s/^...//` | |
| last_modified=`git show --pretty="format:" --name-only HEAD` | |
| if [ -n "$dirty" ]; then | |
| echo $dirty | |
| else | |
| echo $last_modified | |
| fi |
This file contains hidden or 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 timing = store => next => action => { | |
| performance.mark(`${action.type}_start`); | |
| let result = next(action); | |
| performance.mark(`${action.type}_end`); | |
| performance.measure( | |
| `${action.type}`, | |
| `${action.type}_start`, | |
| `${action.type}_end` | |
| ); | |
| return result; |
NewerOlder