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
| # Build the image with: docker build -t super-opencode . | |
| # Run the container with: docker run -it --volume="$PWD:/app" --workdir="/app" super-opencode | |
| # Use the official Node.js image based on Debian Bullseye (slim version for smaller size) | |
| FROM node:24.13.1-bullseye-slim | |
| # Set the working directory inside the container to /app | |
| WORKDIR /app | |
| # Install system dependencies required for building and running various tools |
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
| /** | |
| * Alpine.js magic property to confirm a change. | |
| * | |
| * Usage: @click="$confirm('Are you sure?').then(copied = true)" | |
| * | |
| * @returns {(message: string) => Promise<void>} - A function that takes the text to display as an argument. | |
| */ | |
| Alpine.magic('confirm', () => { | |
| return (message) => { | |
| return new Promise((resolve, reject) => { |
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
| { | |
| "info": { | |
| "_postman_id": "b3e3e3e3-3e3e-3e3e-3e3e-3e3e3e3e3e3e", | |
| "name": "Sanity HTTP API (Complete + Patches)", | |
| "description": "Full collection for Sanity.io HTTP API including Query, Assets, and comprehensive Mutation/Patch examples.", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "name": "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
| // since the argument variable can only be referenced once, we need this function repeated | |
| fn ex::p($p) = $p->{"c":url.current}; | |
| fn ex::pp($p) = $p->{"c": ex::p(parentPage).c}; | |
| fn ex::ppp($p) = $p->{"c": ex::pp(parentPage).c}; | |
| // will output `level-4/level-3/level-2/level-1` | |
| // usage: { "href": ex::slug(@) } | |
| fn ex::slug($d) = $d{"slug":array::join( | |
| array::compact([ | |
| ex::ppp(parentPage).c, | |
| ex::pp(parentPage).c, |
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
| /* @see https://thecascade.dev/article/least-amount-of-css/ */ | |
| html { | |
| color-scheme: light dark; | |
| } | |
| body { | |
| font-family: system-ui; | |
| font-size: 1.25rem; | |
| line-height: 1.5; | |
| } |
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
| /path/to/chrome --headless \ | |
| --disable-gpu \ | |
| --no-pdf-header-footer \ | |
| --hide-scrollbars \ | |
| --print-to-pdf-margins="0,0,0,0" \ | |
| --print-to-pdf \ | |
| --window-size=1280,720 \ | |
| https://example.com |
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
Show hidden characters
| [ | |
| // press $ when selecting text to wrap it in blade echo tags and a variable | |
| { | |
| "keys": [ | |
| "$" | |
| ], | |
| "command": "insert_snippet", | |
| "args": { | |
| "contents": "{{ \\$${0:$SELECTION} }}" | |
| }, |
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
| <?php | |
| // version the asset path for each deploy | |
| Vite::createAssetPathsUsing(function (string $path): string { | |
| return cache()->rememberForever($path, function () use ($path) { | |
| // "z" is "day of the year" so this value will only change on the day of deployment | |
| return sprintf('%s?v=%s', asset($path), date('z')); | |
| }); | |
| }); |
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
| <?php | |
| if (!function_exists('is_external_url')) { | |
| /** | |
| * Check if a URL is external | |
| */ | |
| function is_external_url(string $url) | |
| { | |
| $test = str(config('app.url'))->basename()->prepend('*')->append('*')->toString(); |
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
| -- @see https://briandouglas.ie/sqlite-defaults/ | |
| -- Set the journal mode to Write-Ahead Logging for concurrency | |
| PRAGMA journal_mode = WAL; | |
| -- Set synchronous mode to NORMAL for performance and data safety balance | |
| PRAGMA synchronous = NORMAL; | |
| -- Set busy timeout to 5 seconds to avoid "database is locked" errors | |
| PRAGMA busy_timeout = 5000; |
NewerOlder