- For each YAML file in a chosen folder, creates a new Apple Note.
- Builds the note body as HTML:
- Title in larger font
- Body in
<pre>to preserve formatting
- Appends the
syntax:line if present and not"None". - Escapes HTML and inserts
U+2060 WORD JOINERaround operators to prevent the Notes' Math Notes rendering from being applied, e.g. original textc = Cloud.find(3070)that looks likec = Cloud×find(3070)(note the weird×glyph). - Types hashtags at the bottom via UI scripting so Notes recognizes them as real tags.
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
| # This file specifies files that are *not* uploaded to Google Cloud Platform | |
| # using gcloud. It follows the same syntax as .gitignore, with the addition of | |
| # "#!include" directives (which insert the entries of the given .gitignore-style | |
| # file at that point). | |
| # | |
| # For more information, run: | |
| # $ gcloud topic gcloudignore | |
| # | |
| .gcloudignore | |
| # If you would like to upload your .git directory, .gitignore file or files |
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
| # frozen_string_literal: true | |
| p RACTOR_COUNT: Ractor.count # => 1 | |
| p IS_MAIN_RACTOR: Ractor.main? # => true | |
| p Ractor.main # => #<Ractor:#1 running> | |
| port = Ractor::Port.new | |
| p port # => #<Ractor::Port to:#1 id:1> | |
| Ractor.new(port) do |port| | |
| p RACTOR_COUNT: Ractor.count # => 2 |
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
| # frozen_string_literal: true | |
| X = 1 | |
| class Rubybox | |
| def self.x = X | |
| def x = ::X | |
| end | |
| # Usage: |
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. download a copy of prod db to localhost | |
| # connect to remote redis database and | |
| # download a snapshot of the entire database | |
| # to a local file on your filesystem | |
| # via https://stackoverflow.com/a/61365048/625840 | |
| # docs https://redis.io/docs/manual/cli/#remote-backups-of-rdb-files | |
| redis-cli -u $PROD_REDIS_URL --rdb dump.rdb |
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 | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
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
| def prime?(n) | |
| return false if n <= 1 | |
| i = 2 | |
| while i * i <= n | |
| return false if n % i == 0 | |
| i += 1 | |
| end | |
| true | |
| end |
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 collections import defaultdict | |
| dict = defaultdict(lambda : 0) | |
| dict["a"] | |
| # => 0 | |
| dict.keys() | |
| # => dict_keys(['a']) | |
| print(dict.get("b")) | |
| # => None | |
| dict.keys() |
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
| matches = dict(['()', '[]', '{}']) | |
| print(matches) | |
| # {'(': ')', '[': ']', '{': '}'} |
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 Positionable | |
| extend ActiveSupport::Concern | |
| included do | |
| scope :by_position, -> { order("#{table_name}.position ASC") } | |
| # or default_scope | |
| end | |
| end |
NewerOlder