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
| ## highlight: ship | |
| Error propagation example checks production, propagation, partial handling, residual handling, and sealing. | |
| $ ship check --show-types bin/main.shp | |
| type ConfigErrors = [ :missing_env(String) | :invalid_port(String) | :invalid_region(String) ] | |
| type OrderErrors = [ :order_not_found(String) | :db_timeout(Int) | :db_corrupt(String) ] | |
| type PaymentErrors = [ :card_declined(String) | :gateway_timeout(Int) | :fraud_hold(String) ] | |
| let read_env = fn(name: String) -> String? [ :missing_env(String) ] { |
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
| // Counter browser program — compiler-known TEA shape. | |
| // init/update return model only; `command` statements emit; handlers live in command block. | |
| program Counter { | |
| model { | |
| count: Int, | |
| step: Int, | |
| is_resetting: Bool, | |
| } |
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
| PgDiff schema diff — all cases: previous schema, current schema, and migration SQL. | |
| $ test-cram-pg-diff | |
| === empty-to-empty === | |
| previous: | |
| (empty) | |
| previous (json): | |
| [] | |
| current: |
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 { TextAttributes } from "@opentui/core"; | |
| import { render, useKeyboard } from "@opentui/react"; | |
| import { Atom, Result, useAtom, useAtomValue } from "@effect-atom/atom-react"; | |
| import { Schema, Effect } from "effect"; | |
| class Coffee extends Schema.Class<Coffee>("Coffee")({ | |
| id: Schema.String, | |
| name: Schema.String, | |
| price: Schema.Number, | |
| description: Schema.String, |
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 { chromium } from 'playwright'; | |
| const struArgs = process.argv.slice(2) | |
| const browser = await chromium.launch({ | |
| headless: false, | |
| args: struArgs, | |
| }); // Set headless: true for background execution | |
| const context = await browser.newContext({ | |
| viewport: null // This removes viewport restrictions, making it use full browser window |
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
| int nvim_get_current_win() { | |
| return 1000; | |
| } |
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
| module User = struct | |
| type t = [ `user of string ] | |
| let t user = `user "teej_dv" | |
| let get (l : [> t ] list) : string = | |
| Core.List.find_map l ~f:(function | |
| | `user s -> Some s | |
| | _ -> None) | |
| |> Core.Option.value_exn | |
| ;; |
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
| [ERROR][2024-11-14 15:18:26] ...lsp/handlers.lua:590 'disconnected /Users/tjdevries/git/topshelf.fm: | |
| /----------------------------------------------------------------------- | |
| | Internal error: Uncaught exception. | |
| | Unix.Unix_error(Unix.ENOENT, "create_process", "ocamlmerlin-mlx") | |
| | Raised by primitive operation at Unix.create_process_gen.(fun) in file "unix.ml", line 922, characters 15-68 | |
| | Called from Stdlib__Fun.protect in file "fun.ml", line 34, characters 8-15 | |
| | Re-raised at Stdlib__Fun.protect in file "fun.ml", line 39, characters 6-52 | |
| | Called from Unix.create_process in file "unix.ml" (inlined), line 925, characters 2-66 | |
| | Called from Merlin_extend__Extend_driver.run in file "src/extend/extend_driver.ml", line 25, characters 4-79 | |
| | Called from Merlin_kernel__Mreader_extend.start in file "src/kernel/mreader_extend.ml", line 50, characters 15-52 |
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
| <div className="min-h-screen bg-black text-green-400 font-mono" /> | |
| (* can we change to *) | |
| <div [%tw min-h-screen bg-black text-green-400 font-mono] /> | |
| <div.tw ... /> | |
| <div className=[%tw ... ] /> | |
| <div className%tw="...." /> |
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
| local ls = require "luasnip" | |
| vim.snippet.expand = ls.lsp_expand | |
| ---@diagnostic disable-next-line: duplicate-set-field | |
| vim.snippet.active = function(filter) | |
| filter = filter or {} | |
| filter.direction = filter.direction or 1 | |
| if filter.direction == 1 then |
NewerOlder