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
| # Python 3 | |
| import collections | |
| Write = collections.namedtuple("Write", ["written"]) | |
| def hello_world(): | |
| yield Write("Hello, world!") | |
| yield Write("Hello, world!") | |
| return 1 | |
| def identity(gen): |
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
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: orange; icon-glyph: quote-right; | |
| // Change these to your usernames! | |
| const user = "spencer" | |
| const jike = "4DDA0425-FB41-4188-89E4-952CA15E3C5E" | |
| const telegram = "realSpencerWoo" | |
| const github = "spencerwooo" |
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
| name: Security audit | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| paths: | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| jobs: | |
| security_audit: |
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
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2025 | |
| * https://bsky.app/profile/tholanda.com | |
| * | |
| * (the twitter account is now deleted, please, do not try to reach me there) | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license |
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
| // tl;dr: FileManager.default.url(for:in:appropriateFor:create:) has unexpected behavior in Simulator and creates temporary folders outside the tmp/ directory. | |
| let tmpDirClassic = NSTemporaryDirectory() | |
| print("tmpDirClassic: \(tmpDirClassic)") | |
| // This is the same code, just syntax sugar for NSTemporaryDirectory() | |
| // https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/FileManager.swift#L1420-L1422 | |
| let tmpDirClassicNewShim = FileManager.default.temporaryDirectory | |
| print("tmpDirClassicNewShim: \(tmpDirClassicNewShim)") | |
| // Simulator: /Users/steipete/Library/Developer/CoreSimulator/Devices/31C05637-B9C9-482C-A6CE-D063A7CECF64/data/Containers/Data/Application/A68D11A4-88BA-4FCF-A8B1-D102945D0740/tmp/ |
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
| from functools import partial, reduce | |
| from itertools import chain | |
| from typing import Callable, Any, Sequence, Optional, Mapping | |
| class FnChain: | |
| """ | |
| FnChain(obj).map(...).filter(...).reduce(...)... | |
| API LIST: |
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
| on openTerminal(location, remoteHost, serverPort) | |
| tell application "System Events" | |
| -- some versions might identify as "iTerm2" instead of "iTerm" | |
| set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2")) | |
| end tell | |
| tell application "iTerm" | |
| activate | |
| set targetTab to "" |
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
| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |
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
| <?xml version="1.0"?> | |
| <root> | |
| <inputsourcedef> | |
| <name>MY_keylayout_zh_Hans</name> | |
| <inputsourceid_prefix>com.apple.inputmethod.SCIM.ITABC</inputsourceid_prefix> | |
| </inputsourcedef> | |
| <item> | |
| <name>markdown</name> | |
| <identifier>private.quick_dotOfEnglish</identifier> |