A small sketch for a composable validation library.
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 bun | |
| import fs from "fs"; | |
| import { parse } from "jsonc-parser"; | |
| // Usage | |
| // bun convert.ts <file>.jsonc <themne-name>.conf | |
| // You get your jsonc file from Developer: Generate Color Theme from Current Settings on Vscode command pallete | |
| if (process.argv.length < 3) { | |
| console.error("Usage: convert.ts <vscode-theme.jsonc> [output.ghostty]"); |
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
| // | |
| // Original version by KroneCorylus, ref https://github.com/KroneCorylus/shader-playground/blob/main/shaders/cursor_smear_fade.glsl | |
| // | |
| // Modifications: | |
| // - Base the cursor trail color on the current cursor color, which can be configured | |
| // in ghostty's config using `cursor-color`, ref https://ghostty.org/docs/config/reference#cursor-color | |
| // - Cursor trail is partially transparent, which gives a nice fade effect | |
| // - Cursor trail's maximum opacity is configurable using `TRAIL_MAX_OPACITY` | |
| // |
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
| Having tried a couple of the previous shortcut solutions for iOS I was convinced something easier was possible using the API. The below is my first proper go at putting something together. | |
| This shortcut will be available when "sharing" a URL from within a browser on iOS. On sharing to this shortcut it will automatically pull all available tags from the Linkding server and allow multi-tagging for the URL. | |
| Limitations: | |
| - Currently only previously defined tags can be used | |
| - Title will rely on the automatic process on the server, manual override isn't available | |
| - The same applies to the description | |
| - Tags are currently listed in the order they were created. Alphabetical would make more sense. |
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
| .theme-dark { | |
| --dataview-key: #ffc94a; | |
| --dataview-value: #ffffff; | |
| } | |
| .theme-light { | |
| --dataview-key: #000; | |
| --dataview-value: #000; | |
| } |
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
| // ==UserScript== | |
| // @name Hypothesis | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author AFuture | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== |
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
| /** | |
| * I use .app-container to get around CSS selector specificity | |
| */ | |
| .app-container pre[class*="language-note-"] { | |
| border: 2px solid; | |
| } | |
| /* Make the first line of note bold */ | |
| *[class*="language-note"]::first-line { |
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
| /* | |
| In response of Tom Lokhort's article. | |
| A third alternative: alternative 2 under steroïds | |
| --- | |
| Source: http://tom.lokhorst.eu/2017/07/strongly-typed-identifiers-in-swift | |
| */ | |
| struct GenericIdentifier<T>: RawRepresentable, Hashable, Equatable { | |
| let rawValue: 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
| struct CustomViewModel { | |
| let data: String | |
| init(data: String) { | |
| self.data = data | |
| } | |
| } | |
| final class CustomViewController: ViewController<CustomViewModel> { | |
| override func viewDidLoad() { |
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 Foundation | |
| // Some clearly non-NSObject-based models: | |
| enum Coconut: String { | |
| case small, medium, large | |
| } | |
| struct Tomato { | |
| static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1)) |
NewerOlder