diff --git a/.gitattributes b/.gitattributes index fd5994a6297..8b17f71c0e7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,9 @@ -package-lock.json -diff +# Mark files as having been generated. +package-lock.json linguist-generated +Gemfile.lock linguist-generated +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3df85cb146c..cc0e7986fa5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: [ 'javascript', 'ruby' ] steps: - name: Checkout repository @@ -29,9 +29,10 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 + diff --git a/.github/workflows/deploy-production-push.yml b/.github/workflows/deploy-production-push.yml index d1f6a8963fe..cbf283a4728 100644 --- a/.github/workflows/deploy-production-push.yml +++ b/.github/workflows/deploy-production-push.yml @@ -24,5 +24,5 @@ jobs: DEPLOY_TRIGGER: ${{ github.event_name }} if: steps.filter.outputs.web == 'true' run: | - chmod +x ./src/scripts/deploy.sh - ./src/scripts/deploy.sh production + chmod +x ./bin/deploy + ./bin/deploy production diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 433c6b11c59..a4a5045c2a6 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -13,5 +13,5 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} DEPLOY_TRIGGER: ${{ github.event_name }} run: | - chmod +x ./src/scripts/deploy.sh - ./src/scripts/deploy.sh production + chmod +x ./bin/deploy + ./bin/deploy production diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..a76a1b4120e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Run tests +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + js_tests: + name: 'Node.js ${{ matrix.node-version }} tests' + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.11.1] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test + + rspec_tests: + name: 'Ruby ${{ matrix.ruby-version }} tests' + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: [3.3.3] + env: + RAILS_ENV: test + steps: + - uses: actions/checkout@v4 + - name: Use Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + - run: gem install bundler + - run: bundle install + - run: rake db:test:prepare + - run: bundle exec rspec diff --git a/.gitignore b/.gitignore index e94221b573a..48cf39f31b7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,12 +9,16 @@ test_old/ coverage/ # Logs +/log/* logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* +# Tempfiles +/tmp/* + # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json @@ -77,6 +81,8 @@ yarn-error.log .yarn-integrity # dotenv environment variables file +/.env* +!/.env*.erb .env # parcel-bundler cache (https://parceljs.org/) @@ -109,7 +115,6 @@ out/ # gatsby files .cache/ -public # Mac files .DS_Store @@ -130,7 +135,6 @@ dist/ .assets .content content/data -public/assets public/sitemap.xml public/feed.xml public/chirp.json @@ -140,3 +144,9 @@ snippet.png # Imported files for development imported/ + +# Storage (SQLite databases) +/storage/* + +# Master key for decrypting credentials +/config/master.key diff --git a/.irbrc b/.irbrc new file mode 100644 index 00000000000..3325c79eb30 --- /dev/null +++ b/.irbrc @@ -0,0 +1,7 @@ +PreparedQueries.instance_methods.each do |method| + define_method(method) do |*args| + PreparedQueries.instance_method(method).bind_call(self, *args) + end +end + +# More ideas here: https://medium.com/simply-dev/do-more-with-rails-console-by-configuring-irbrc-e5c25284305d diff --git a/.rspec b/.rspec new file mode 100644 index 00000000000..c99d2e7396e --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000000..1f5ed110792 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,684 @@ +require: + - rubocop-rails + - rubocop-rspec + - rubocop-rake + - rubocop-performance + +AllCops: + TargetRubyVersion: 3.2 + NewCops: enable + SuggestExtensions: false + Exclude: + - 'node_modules/**/*' + - 'dist/**/*' + - 'parsley/**/*' + - 'imported/**/*' + - 'tmp/**/*' + - 'astro/**/*' + - 'vendor/**/*' + - '.content/**/*' + - '.astro/**/*' + - '.github/**/*' + - '.vscode/**/*' + - 'db/schema.rb' + +Metrics: + Enabled: false + +Bundler/OrderedGems: + Exclude: + - 'Gemfile' + +Layout/BeginEndAlignment: + Enabled: false + +Layout/BlockAlignment: + Enabled: false + +Layout/BlockEndNewline: + Enabled: false + +Layout/DotPosition: + EnforcedStyle: trailing + +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false + +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'Gemfile' + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/FirstHashElementIndentation: + EnforcedStyle: consistent + +Layout/LineContinuationLeadingSpace: + Enabled: false + +Layout/LineContinuationSpacing: + Enabled: false + +Layout/LineEndStringConcatenationIndentation: + Enabled: false + +Layout/LineLength: + Max: 120 + +Layout/MultilineBlockLayout: + Enabled: false + +Layout/MultilineMethodCallBraceLayout: + Enabled: false + +Layout/MultilineMethodCallIndentation: + Enabled: false + +Layout/MultilineOperationIndentation: + Enabled: false + +Layout/SpaceAroundMethodCallOperator: + Enabled: false + +Lint/AmbiguousBlockAssociation: + Enabled: false + +Lint/AmbiguousOperatorPrecedence: + Enabled: false + +Lint/AmbiguousRegexpLiteral: + Enabled: false + +Lint/AssignmentInCondition: + Enabled: false + +Lint/ConstantDefinitionInBlock: + Enabled: false + +Lint/DuplicateBranch: + Enabled: false + +Lint/EmptyBlock: + Enabled: false + +Lint/EmptyClass: + AllowComments: true + +Lint/EmptyFile: + Exclude: + - 'config/settings/**/*' + +Lint/FloatComparison: + Enabled: false + +Lint/IneffectiveAccessModifier: + Enabled: false + +Lint/MissingSuper: + Enabled: false + +Lint/NoReturnInBeginEndBlocks: + Enabled: false + +Lint/NonAtomicFileOperation: + Enabled: false + +Lint/ParenthesesAsGroupedExpression: + Enabled: false + +Lint/ShadowingOuterLocalVariable: + Enabled: false + +Lint/SuppressedException: + Enabled: false + +Lint/SymbolConversion: + Enabled: false + +Lint/UnusedBlockArgument: + Enabled: false + +Lint/UnusedMethodArgument: + Enabled: false + +Lint/UselessAccessModifier: + ContextCreatingMethods: + - class_methods + - concerning + - has_many + +Lint/UselessAssignment: + Exclude: + - "spec/**/*" + +Lint/Void: + Enabled: false + +Naming/AccessorMethodName: + Enabled: false + +Naming/BlockForwarding: + Enabled: false + +Naming/MemoizedInstanceVariableName: + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/PredicateName: + Enabled: false + +Naming/VariableNumber: + Enabled: false + +Performance/CollectionLiteralInLoop: + Enabled: false + +Performance/Count: + Enabled: false + +Performance/Detect: + Enabled: false + +Performance/InefficientHashSearch: + Enabled: false + +Performance/MapCompact: + Enabled: false + +Performance/RedundantMerge: + Enabled: false + +Performance/RegexpMatch: + Enabled: false + +Performance/StringIdentifierArgument: + Enabled: false + +Performance/StringInclude: + Enabled: false + +Performance/StringReplacement: + Enabled: false + +Performance/Sum: + Enabled: false + +Performance/TimesMap: + Enabled: false + +RSpec/AnyInstance: + Enabled: false + +RSpec/Be: + Enabled: false + +RSpec/BeEq: + Enabled: false + +RSpec/BeNil: + Enabled: false + +RSpec/BeforeAfterAll: + Enabled: false + +RSpec/ClassCheck: + Enabled: false + +RSpec/ContextMethod: + Enabled: false + +RSpec/ContextWording: + Enabled: false + +RSpec/DescribeClass: + Enabled: false + +RSpec/DescribedClass: + Enabled: false + +RSpec/EmptyExampleGroup: + Enabled: false + +RSpec/ExampleLength: + Max: 103 + +RSpec/ExampleWording: + Enabled: false + +RSpec/ExcessiveDocstringSpacing: + Enabled: false + +RSpec/ExpectChange: + Enabled: false + +RSpec/ExpectInHook: + Enabled: false + +RSpec/ImplicitSubject: + Enabled: false + +RSpec/InstanceVariable: + Enabled: false + +RSpec/LeadingSubject: + Enabled: false + +RSpec/LeakyConstantDeclaration: + Enabled: false + +RSpec/LetBeforeExamples: + Enabled: false + +RSpec/LetSetup: + Enabled: false + +RSpec/MessageChain: + Enabled: false + +RSpec/MessageSpies: + Enabled: false + +RSpec/MultipleExpectations: + Max: 31 + +RSpec/MultipleMemoizedHelpers: + Max: 123 + +RSpec/NamedSubject: + Enabled: false + +RSpec/NestedGroups: + Max: 12 + +RSpec/NoExpectationExample: + Enabled: false + +RSpec/NotToNot: + EnforcedStyle: not_to + +RSpec/OverwritingSetup: + Enabled: false + +RSpec/PendingWithoutReason: + Enabled: false + +RSpec/PredicateMatcher: + Enabled: false + +RSpec/RepeatedDescription: + Enabled: false + +RSpec/RepeatedExample: + Enabled: false + +RSpec/RepeatedExampleGroupBody: + Enabled: false + +RSpec/RepeatedExampleGroupDescription: + Enabled: false + +RSpec/ReturnFromStub: + Enabled: false + +RSpec/ScatteredLet: + Enabled: false + +RSpec/ScatteredSetup: + Enabled: false + +RSpec/SortMetadata: + Enabled: false + +RSpec/StubbedMock: + Enabled: false + +RSpec/SubjectDeclaration: + Enabled: false + +RSpec/SubjectStub: + Enabled: false + +RSpec/VerifiedDoubleReference: + Enabled: false + +RSpec/VerifiedDoubles: + Enabled: false + +Rails/ActionOrder: + Enabled: false + +Rails/ActiveRecordCallbacksOrder: + Enabled: false + +Rails/CompactBlank: + Enabled: false + +Rails/ContentTag: + Enabled: false + +Rails/CreateTableWithTimestamps: + Enabled: false + +Rails/Date: + Enabled: false + +Rails/Delegate: + Enabled: false + +Rails/DynamicFindBy: + Enabled: false + +Rails/ExpandedDateRange: + Enabled: false + +Rails/FilePath: + Enabled: false + +Rails/FindBy: + Enabled: false + +Rails/FindEach: + Enabled: false + +Rails/HasAndBelongsToMany: + Enabled: false + +Rails/HasManyOrHasOneDependent: + Enabled: false + +Rails/HelperInstanceVariable: + Enabled: false + +Rails/HttpStatus: + Enabled: false + +Rails/I18nLocaleTexts: + Enabled: false + +Rails/IndexBy: + Enabled: false + +Rails/IndexWith: + Enabled: false + +Rails/InverseOf: + Enabled: false + +Rails/LexicallyScopedActionFilter: + Enabled: false + +Rails/LinkToBlank: + Enabled: false + +Rails/NegateInclude: + Enabled: false + +Rails/Output: + Enabled: false + +Rails/OutputSafety: + Enabled: false + +Rails/Pick: + Enabled: false + +Rails/Pluck: + Enabled: false + +Rails/RedundantForeignKey: + Enabled: false + +Rails/RedundantPresenceValidationOnBelongsTo: + Enabled: false + +Rails/ReversibleMigration: + Enabled: false + +Rails/RootPathnameMethods: + Enabled: false + +Rails/RootPublicPath: + Enabled: false + +Rails/SkipsModelValidations: + Enabled: false + +Rails/SquishedSQLHeredocs: + Enabled: false + +Rails/TimeZone: + Enabled: false + +Rails/ToSWithArgument: + Enabled: false + +Rails/UnknownEnv: + Enabled: false + +Rails/Validation: + Enabled: false + +Rails/WhereEquals: + Enabled: false + +Rails/WhereExists: + Enabled: false + +Rails/WhereNot: + Enabled: false + +Rake/Desc: + Enabled: false + +Style/AccessorGrouping: + Enabled: false + +Style/Alias: + Enabled: false + +Style/AndOr: + EnforcedStyle: conditionals + +Style/ArrayIntersect: + Enabled: false + +Style/CaseLikeIf: + Enabled: false + +Style/ClassAndModuleChildren: + Enabled: false + +Style/ClassVars: + Enabled: false + +Style/ColonMethodCall: + Enabled: false + +Style/CommentAnnotation: + Enabled: false + +Style/CommentedKeyword: + Enabled: false + +Style/ConcatArrayLiterals: + Enabled: false + +Style/ConditionalAssignment: + Enabled: false + +Style/Documentation: + Enabled: false + +Style/DoubleNegation: + Enabled: false + +Style/ExpandPathArguments: + Exclude: + - 'Rakefile' + - 'bin/bundle' + - 'bin/rails' + - 'bin/rake' + - 'bin/setup' + +Style/ExplicitBlockArgument: + Enabled: false + +Style/FetchEnvVar: + Enabled: false + +Style/FloatDivision: + Enabled: false + +Style/FormatString: + Enabled: false + +Style/FormatStringToken: + Enabled: false + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/GlobalStdStream: + Enabled: false + +Style/GlobalVars: + Exclude: + - 'config.ru' + +Style/GuardClause: + Enabled: false + +Style/HashAsLastArrayItem: + Enabled: false + +Style/HashConversion: + Enabled: false + +Style/HashEachMethods: + Enabled: false + +Style/HashLikeCase: + Enabled: false + +Style/HashSyntax: + EnforcedShorthandSyntax: either + +Style/HashTransformValues: + Enabled: false + +Style/IfUnlessModifier: + Enabled: false + +Style/Lambda: + Enabled: false + +Style/LineEndConcatenation: + Enabled: false + +Style/MapToHash: + Enabled: false + +Style/MapToSet: + Enabled: false + +Style/ModuleFunction: + Enabled: false + +Style/MultilineBlockChain: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + +Style/NegatedIf: + EnforcedStyle: postfix + +Style/NegatedIfElseCondition: + Enabled: false + +Style/Next: + Enabled: false + +Style/NumericLiterals: + MinDigits: 11 + +Style/NumericPredicate: + Enabled: false + +Style/OpenStructUse: + Enabled: false + +Style/OptionalBooleanParameter: + Enabled: false + +Style/PercentLiteralDelimiters: + Enabled: false + +Style/QuotedSymbols: + Enabled: false + +Style/RedundantArgument: + Enabled: false + +Style/RedundantAssignment: + Enabled: false + +Style/RedundantBegin: + Enabled: false + +Style/RedundantConstantBase: + Enabled: false + +Style/RedundantFileExtensionInRequire: + Enabled: false + +Style/RedundantFreeze: + Enabled: false + +Style/RedundantLineContinuation: + Enabled: false + +Style/RedundantRegexpEscape: + Enabled: false + +Style/RedundantStringEscape: + Enabled: false + +Style/RegexpLiteral: + Enabled: false + +Style/RescueModifier: + Enabled: false + +Style/RescueStandardError: + Enabled: false + +Style/SafeNavigation: + Enabled: false + +Style/SingleArgumentDig: + Enabled: false + +Style/SlicingWithRange: + Enabled: false + +Style/SoleNestedConditional: + Enabled: false + +Style/StderrPuts: + Enabled: false + +Style/StringConcatenation: + Enabled: false + +Style/SymbolProc: + Enabled: false + +Style/SymbolArray: + EnforcedStyle: brackets + +Style/TernaryParentheses: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 00000000000..883432d358f --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,173 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2024-07-25 12:23:03 UTC using RuboCop version 1.65.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 3 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'spec/models/concerns/serializable_spec.rb' + - 'spec/serializers/base_serializer_spec.rb' + +# Offense count: 1 +# Configuration parameters: DebuggerMethods, DebuggerRequires. +Lint/Debugger: + Exclude: + - 'app/presenters/recommendation_presenter.rb' + +# Offense count: 2 +Lint/DuplicateMethods: + Exclude: + - 'app/controllers/feed_controller.rb' + - 'app/controllers/sitemap_controller.rb' + +# Offense count: 3 +# Configuration parameters: AllowComments. +Lint/EmptyFile: + Exclude: + - 'config/settings/development.rb' + - 'config/settings/production.rb' + - 'config/settings/test.rb' + +# Offense count: 1 +# Configuration parameters: AllowedParentClasses. +Lint/MissingSuper: + Exclude: + - 'app/serializers/base_serializer.rb' + +# Offense count: 12 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'app/models/collection.rb' + - 'app/models/concerns/common_api.rb' + - 'app/models/snippet.rb' + - 'app/presenters/cover_presenter.rb' + +# Offense count: 8 +# Configuration parameters: CountAsOne. +RSpec/ExampleLength: + Max: 8 + +# Offense count: 3 +RSpec/LeakyConstantDeclaration: + Exclude: + - 'spec/models/concerns/serializable_spec.rb' + - 'spec/serializers/base_serializer_spec.rb' + +# Offense count: 7 +RSpec/LetSetup: + Exclude: + - 'spec/models/collection_spec.rb' + - 'spec/models/concerns/serializable_spec.rb' + - 'spec/presenters/breadcrumb_presenter_spec.rb' + +# Offense count: 1 +RSpec/MultipleExpectations: + Max: 2 + +# Offense count: 45 +# Configuration parameters: AllowSubject. +RSpec/MultipleMemoizedHelpers: + Max: 11 + +# Offense count: 9 +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only +RSpec/NamedSubject: + Exclude: + - 'spec/presenters/recommendation_presenter_spec.rb' + - 'spec/serializers/base_serializer_spec.rb' + +# Offense count: 8 +# Configuration parameters: Include. +# Include: db/**/*.rb +Rails/CreateTableWithTimestamps: + Exclude: + - 'db/migrate/20240612153832_initialize_database.rb' + - 'db/schema.rb' + +# Offense count: 6 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/HasManyOrHasOneDependent: + Exclude: + - 'app/models/collection.rb' + - 'app/models/language.rb' + - 'app/models/snippet.rb' + +# Offense count: 6 +# Configuration parameters: IgnoreScopes, Include. +# Include: app/models/**/*.rb +Rails/InverseOf: + Exclude: + - 'app/models/collection.rb' + - 'app/models/collection_snippet.rb' + - 'app/models/language.rb' + - 'app/models/snippet.rb' + +# Offense count: 1 +# Configuration parameters: ForbiddenMethods, AllowedMethods. +# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all +Rails/SkipsModelValidations: + Exclude: + - 'lib/json_importer.rb' + +# Offense count: 6 +# Configuration parameters: Include. +# Include: db/**/*.rb +Rails/ThreeStateBooleanColumn: + Exclude: + - 'db/migrate/20240612153832_initialize_database.rb' + - 'db/schema.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowOnConstant, AllowOnSelfClass. +Style/CaseEquality: + Exclude: + - 'app/models/snippet.rb' + - 'app/presenters/sublink_presenter.rb' + +# Offense count: 15 +Style/ClassVars: + Exclude: + - 'app/models/collection.rb' + - 'app/presenters/cover_presenter.rb' + - 'app/presenters/recommendation_presenter.rb' + - 'lib/performance_tracking.rb' + - 'lib/redirects.rb' + +# Offense count: 37 +# Configuration parameters: AllowedConstants. +Style/Documentation: + Enabled: false + +# Offense count: 6 +Style/MultilineBlockChain: + Exclude: + - 'app/presenters/recommendation_presenter.rb' + - 'lib/prepared_queries.rb' + +# Offense count: 1 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'app/presenters/sublink_presenter.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 137 diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000000..fefb2b70d22 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-3.3.3 diff --git a/.vscode/settings.json b/.vscode/settings.json index 3198221b08b..b36b76af7fa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -52,4 +52,8 @@ "markdown" ], "spellright.configurationScope": "workspace", + "spellright.ignoreFiles": [ + "**/.gitignore", + ".rubocop.yml" + ] } diff --git a/.vscode/spellright.dict b/.vscode/spellright.dict index 9a027804e9e..14465280f2d 100644 --- a/.vscode/spellright.dict +++ b/.vscode/spellright.dict @@ -31,3 +31,5 @@ autosquashed unstage flexbox timelapse +stringify +blockable diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000000..9e113651390 --- /dev/null +++ b/Gemfile @@ -0,0 +1,75 @@ +source 'https://rubygems.org' + +ruby '3.3.3' + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem 'rails', '~> 7.1.3', '>= 7.1.3.4' + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem 'sprockets-rails' + +# Use sqlite3 as the database for Active Record +gem 'sqlite3', '~> 1.4' + +# Use the Puma web server [https://github.com/puma/puma] +gem 'puma', '>= 5.0' + +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem 'importmap-rails' + +# Use Dart SASS [https://github.com/rails/dartsass-rails] +gem 'dartsass-rails' + +# Use Redis adapter to run Action Cable in production +# gem "redis", ">= 4.0.1" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:windows, :jruby] + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem 'debug', platforms: [:mri, :windows] + + # Fixtures replacement + gem 'factory_bot_rails', '~> 6.4' +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem 'web-console' + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" + + # Test suite + gem 'rspec' + gem 'rspec-rails' + + # Linting + gem 'rubocop' + gem 'rubocop-performance' + gem 'rubocop-rails' + gem 'rubocop-rake' + gem 'rubocop-rspec' +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem 'capybara' + gem 'selenium-webdriver' +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000000..e3583ae437b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,386 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) + globalid (>= 0.3.6) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) + marcel (~> 1.0) + activesupport (7.1.3.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) + bindex (0.8.1) + bootsnap (1.18.3) + msgpack (~> 1.2) + builder (3.3.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + crass (1.0.6) + dartsass-rails (0.5.0) + railties (>= 6.0.0) + sass-embedded (~> 1.63) + date (3.3.4) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.0) + factory_bot (6.4.6) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) + railties (>= 5.0.0) + globalid (1.2.1) + activesupport (>= 6.1) + google-protobuf (4.27.1) + bigdecimal + rake (>= 13) + google-protobuf (4.27.1-aarch64-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.27.1-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.27.1-x86-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.27.1-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.27.1-x86_64-linux) + bigdecimal + rake (>= 13) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + importmap-rails (2.0.1) + actionpack (>= 6.0.0) + activesupport (>= 6.0.0) + railties (>= 6.0.0) + io-console (0.7.2) + irb (1.13.1) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.23.1) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.12) + date + net-protocol + net-pop (0.1.2) + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol + nio4r (2.7.3) + nokogiri (1.16.6-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.6-arm-linux) + racc (~> 1.4) + nokogiri (1.16.6-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.6-x86-linux) + racc (~> 1.4) + nokogiri (1.16.6-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.6-x86_64-linux) + racc (~> 1.4) + parallel (1.25.1) + parser (3.3.4.0) + ast (~> 2.4.1) + racc + psych (5.1.2) + stringio + public_suffix (5.0.5) + puma (6.4.2) + nio4r (~> 2.0) + racc (1.8.0) + rack (3.1.3) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + bundler (>= 1.15.0) + railties (= 7.1.3.4) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + regexp_parser (2.9.2) + reline (0.5.9) + io-console (~> 0.5) + rexml (3.3.0) + strscan + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.3) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.65.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (3.0.3) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + sass-embedded (1.77.5-aarch64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-aarch64-linux-musl) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm-linux-gnueabihf) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm-linux-musleabihf) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm64-darwin) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86-linux-musl) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-darwin) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-linux-musl) + google-protobuf (>= 3.25, < 5.0) + selenium-webdriver (4.21.1) + base64 (~> 0.2) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sqlite3 (1.7.3-aarch64-linux) + sqlite3 (1.7.3-arm-linux) + sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86-linux) + sqlite3 (1.7.3-x86_64-darwin) + sqlite3 (1.7.3-x86_64-linux) + stringio (3.1.1) + strscan (3.1.0) + thor (1.3.1) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webrick (1.8.1) + websocket (1.2.10) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.15) + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnueabihf + arm-linux-musleabihf + arm64-darwin-23 + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + bootsnap + capybara + dartsass-rails + debug + factory_bot_rails (~> 6.4) + importmap-rails + puma (>= 5.0) + rails (~> 7.1.3, >= 7.1.3.4) + rspec + rspec-rails + rubocop + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec + selenium-webdriver + sprockets-rails + sqlite3 (~> 1.4) + tzinfo-data + web-console + +RUBY VERSION + ruby 3.3.3p89 + +BUNDLED WITH + 2.5.12 diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000000..e85f913914b --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/adapters/page.rb b/app/adapters/page.rb new file mode 100644 index 00000000000..822770781f0 --- /dev/null +++ b/app/adapters/page.rb @@ -0,0 +1,62 @@ +class Page + def self.from(object, options = {}) + "Page::#{object.class.name}".constantize.new(object, options) + end + + def self.home + Page::Home.new(nil) + end + + class Base + attr_reader :object, :options + + def initialize(object, options = {}) + @object = object + @options = options + end + + def serialize + @serialize ||= PageSerializer.serialize(self) + end + + def key + @key ||= params.values.flatten.join('/') + end + + def params + raise NotImplementedError + end + + def props + raise NotImplementedError + end + + def schema_data + return @schema_data if defined?(@schema_data) + + @schema_data = { + '@context': 'https://schema.org', + '@type': object.is_snippet? ? 'TechArticle' : 'ItemList', + url: object.full_url, + main_entity_of_page: { + '@type': 'WebPage', + '@id': object.full_url + } + } + + if defined?(additional_schema_data) + @schema_data.merge!(additional_schema_data) + end + + @schema_data.deep_transform_keys! do |key| + key.to_s.camelize(:lower) + end + end + + protected + + def slug_segments + @slug_segments ||= object.slug.slice(1..-1).split('/') + end + end +end diff --git a/app/adapters/page/collection.rb b/app/adapters/page/collection.rb new file mode 100644 index 00000000000..3a9cf7a9549 --- /dev/null +++ b/app/adapters/page/collection.rb @@ -0,0 +1,64 @@ +class Page::Collection < Page::Base + def key + @key ||= "#{slug_segments.join('/')}/p/#{options[:page_number]}" + end + + def params + return @params if defined?(@params) + + @params = { + lang: slug_segments.first, + listing: [*slug_segments.drop(1), 'p', options[:page_number].to_s] + } + end + + # Collection.preload(:collection_snippets, :parent, :children, snippets: [:language]).map(&:pages).flatten + def props + return @context if defined?(@context) + + @context = { + slug: page_slug, + page_description: object.seo_description, + collection: object.context, + pagination: pagination, + collection_items: options[:items].map(&:preview), + large_images: options[:large_images] + } + end + + def additional_schema_data + { + name: object.title, + number_of_items: options[:items].count, + item_list_element: options[:items].each_with_index.map do |item, i| + { + '@type': 'ListItem', + position: i + 1, + url: item.full_url, + name: item.preview_title + } + end + } + end + + private + + def page_slug + @page_slug ||= "#{object.slug}/p/#{options[:page_number]}" + end + + def pagination + return @pagination if defined?(@pagination) + return @pagination = nil if options[:page_count] <= 1 + + @pagination = { + page_number: options[:page_number], + total_pages: options[:page_count], + base_url: object.slug, + has_previous: options[:page_number] > 1, + has_next: options[:page_number] < options[:page_count], + total_items: options[:item_count], + item_type: options[:item_type] + } + end +end diff --git a/app/adapters/page/home.rb b/app/adapters/page/home.rb new file mode 100644 index 00000000000..7afb78207b6 --- /dev/null +++ b/app/adapters/page/home.rb @@ -0,0 +1,96 @@ +class Page::Home < Page::Base + def params + nil + end + + def props + return @context if defined?(@context) + + @context = { + featured_collections: featured_collections, + featured_snippets: featured_snippets, + splash_image: cover_url, + splash_image_srcset: cover_srcset, + snippet_list_url: main_listing_url, + page_description: seo_description + } + end + + def schema_data + { + '@context': 'https://schema.org', + '@type': 'WebSite', + url: Orbit::settings[:website][:url] + } + end + + private + + def featured_collections + Collection. + preload(:collection_snippets). + featured. + first(Orbit::settings[:top_collection_chips]). + map(&:preview). + concat([explore_collections_hash]) + end + + def featured_snippets + new_snippets = + Snippet. + preload(:language, :collection_snippets, :collections). + listed. + by_new. + first(Orbit::settings[:new_snippet_cards]) + + top_snippets = + Snippet. + preload(:language, :collection_snippets, :collections). + listed. + ranked. + first(Orbit::settings[:top_snippet_cards] * 5). + to_a. + shuffle + + [new_snippets, top_snippets]. + flatten. + uniq. + first( + Orbit::settings[:new_snippet_cards] + Orbit::settings[:top_snippet_cards] + ).map(&:preview) + end + + def seo_description + Orbit::settings[:website][:seo_description] % { + snippet_count: Snippet.published.count, + website_name: Orbit::settings[:website][:name] + } + end + + def main_listing_url + Collection.main.first_page_slug + end + + def explore_collections_hash + { + title: 'Explore collections', + url: Collection.collections.first_page_slug, + icon: 'arrow-right', + selected: false + } + end + + def cover_presenter + @cover_presenter ||= CoverPresenter.new({ + cover: Orbit::settings[:home_cover] + }) + end + + def cover_url + cover_presenter.cover_url + end + + def cover_srcset + cover_presenter.cover_srcset + end +end diff --git a/app/adapters/page/snippet.rb b/app/adapters/page/snippet.rb new file mode 100644 index 00000000000..ede228117c5 --- /dev/null +++ b/app/adapters/page/snippet.rb @@ -0,0 +1,45 @@ +class Page::Snippet < Page::Base + def key + @key ||= "#{slug_segments.first}/s/#{slug_segments.last}" + end + + def params + return @params if defined?(@params) + + @params = { + lang: slug_segments.first, + snippet: slug_segments.last + } + end + + # Snippet.preload(:language, :collection_snippets, :collections).published.map(&:page) + def props + return @context if defined?(@context) + + @context = { + breadcrumbs: object.breadcrumbs, + page_description: object.seo_description, + snippet: object.context, + recommendations: [ + object.recommended_collection, + *object.recommended_snippets + ].compact.first(4).map(&:preview) + } + end + + def additional_schema_data + { + name: object.seo_title, + headline: object.seo_title, + description: object.seo_description, + image: object.cover_full_url, + date_published: object.date_modified, + date_modified: object.date_modified, + publisher: { + '@type': 'Person', + name: Orbit::settings[:owner_name], + url: Orbit::settings[:owner_url] + } + } + end +end diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 00000000000..591819335f0 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 00000000000..288b9ab7182 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 00000000000..09705d12ab4 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/app/controllers/feed_controller.rb b/app/controllers/feed_controller.rb new file mode 100644 index 00000000000..138bb313a31 --- /dev/null +++ b/app/controllers/feed_controller.rb @@ -0,0 +1,14 @@ +class FeedController < ApplicationController + def index + @nodes = nodes + end + + def generate_feed + feed = render_to_string 'feed/index', layout: false, locals: { nodes: nodes } + File.write('public/feed.xml', feed) + end + + def nodes + Snippet.listed.by_new.first(50) + end +end diff --git a/app/controllers/sitemap_controller.rb b/app/controllers/sitemap_controller.rb new file mode 100644 index 00000000000..28b3c77f7a8 --- /dev/null +++ b/app/controllers/sitemap_controller.rb @@ -0,0 +1,23 @@ +class SitemapController < ApplicationController + HOME_PAGE_URL = "#{Orbit::settings[:website][:url]}/".freeze + STATIC_PAGE_URLS = [ + "#{Orbit::settings[:website][:url]}/about", + "#{Orbit::settings[:website][:url]}/faw" + ].freeze + + def index + @urls = urls + end + + def generate_sitemap + sitemap = render_to_string 'sitemap/index', layout: false, locals: { urls: urls } + File.write('public/sitemap.xml', sitemap) + end + + def urls + [HOME_PAGE_URL] + + Snippet.published.map(&:full_url) + + Collection.all.map(&:all_page_full_urls).flatten + + STATIC_PAGE_URLS + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 00000000000..de6be7945c6 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 00000000000..d394c3d1062 --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 00000000000..b63caeb8a5c --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/app/models/collection.rb b/app/models/collection.rb new file mode 100644 index 00000000000..c2196089f5a --- /dev/null +++ b/app/models/collection.rb @@ -0,0 +1,209 @@ +class Collection < ApplicationRecord + include CommonApi + + MAIN_COLLECTION_CID = 'snippets'.freeze + COLLECTIONS_COLLECTION_CID = 'collections'.freeze + MORE_COLLECTIONS_SUBLINK = { + title: 'More', + url: '/collections/p/1', + icon: 'arrow-right', + selected: false + }.freeze + + # https://guides.rubyonrails.org/v5.0/association_basics.html + has_one :parent, + class_name: 'Collection', + foreign_key: 'cid', + primary_key: 'parent_cid', + inverse_of: :children + has_many :children, + class_name: 'Collection', + foreign_key: 'parent_cid', + primary_key: 'cid', + inverse_of: :parent + + has_many :collection_snippets, + foreign_key: 'collection_cid' + + has_many :snippets, + through: :collection_snippets + + scope :with_parent, -> { where.not(parent_cid: nil) } + scope :snippet_collections, -> { where.not(cid: COLLECTIONS_COLLECTION_CID) } + scope :primary, -> { where(top_level: true) } + scope :secondary, -> { with_parent } + scope :listed, -> { where(listed: true) } + scope :featured, -> do + where.not(featured_index: nil).order(featured_index: :asc) + end + + # Cache the main collection on the class level to avoid repeated queries. + @@main_collection = nil + # Cache the collections collection on the class level to avoid repeated queries. + @@collections_collection = nil + + # Nasty business with counts + @counts = {} + + def self.prepare_counts + @counts = CollectionSnippet.published.listed.group(:collection_cid).count + end + + def self.get_count(cid) + @counts[cid] + end + + def listed_snippet_count + return @listed_snippet_count if defined?(@listed_snippet_count) + + @listed_snippet_count ||= + Collection.get_count(cid) || collection_snippets.published.listed.count + end + # End of nasty business + + def self.main + @@main_collection ||= find(MAIN_COLLECTION_CID) + end + + def self.collections + @@collections_collection ||= find(COLLECTIONS_COLLECTION_CID) + end + + def has_parent? + @has_parent ||= parent_cid.present? + end + + def is_main? + @is_main ||= cid == MAIN_COLLECTION_CID + end + + def is_collections? + @is_collections ||= cid == COLLECTIONS_COLLECTION_CID + end + + def is_primary? + @is_primary ||= top_level? + end + + def is_secondary? + @is_secondary ||= has_parent? + end + + def root_url + # To avoid an extra query, we recreate the parent's slug here. + @root_url ||= has_parent? ? parent_cid.to_seo_slug : slug + end + + def siblings + @siblings ||= has_parent? ? parent.children : [] + end + + def siblings_except_self + siblings - [self] + end + + def search_tokens_array + _tokens.split(';') + end + + def first_page_slug + @first_page_slug ||= "#{slug}/p/1" + end + + def all_page_slugs + @all_page_slugs ||= (1..page_count).map do |page_number| + "#{slug}/p/#{page_number}" + end + end + + def all_page_full_urls + @all_page_full_urls ||= all_page_slugs.map do |page_slug| + "#{Orbit::settings[:website][:url]}#{page_slug}" + end + end + + def page_count + @page_count ||= + (listed_snippet_count / Orbit::settings[:cards_per_page]).ceil + end + + def listed_snippets + @listed_snippets ||= + collection_snippets. + published. + listed. + by_position. + joins(:snippet). + preload(:snippet). + map(&:snippet) + end + + def formatted_snippet_count + @formatted_snippet_count ||= "#{listed_snippet_count} snippets" + end + + def sublinks + @sublinks ||= sublink_presenter.sublinks + end + + # TODO: A little fiddly + def matches_tag(tag) + cid.end_with?("/#{tag}") + end + + def pages + return @pages = collections_pages if cid == COLLECTIONS_COLLECTION_CID + + pagination = { + page_count: page_count, + item_count: listed_snippet_count, + item_type: 'snippets' + } + + @pages ||= (1..page_count).map do |page_number| + Page.from( + self, + page_number: page_number, + items: listed_snippets.slice( + (page_number - 1) * Orbit::settings[:cards_per_page], + Orbit::settings[:cards_per_page] + ), + **pagination, + large_images: false + ) + end + end + + private + + def collections_pages + return @collections_pages if defined?(@collections_pages) + + featured_collections = Collection.featured + featured_collections_count = featured_collections.count + page_count = (featured_collections_count / Orbit::settings[:collection_cards_per_page]).ceil + + pagination = { + page_count: page_count, + item_count: featured_collections_count, + item_type: 'collections' + } + + @collections_pages ||= (1..page_count).map do |page_number| + Page.from( + self, + page_number: page_number, + items: featured_collections.slice( + (page_number - 1) * Orbit::settings[:collection_cards_per_page], + Orbit::settings[:collection_cards_per_page] + ), + **pagination, + large_images: true + ) + end + end + + def sublink_presenter + @sublink_presenter ||= SublinkPresenter.new(self) + end +end diff --git a/app/models/collection_snippet.rb b/app/models/collection_snippet.rb new file mode 100644 index 00000000000..3cd44f36bc5 --- /dev/null +++ b/app/models/collection_snippet.rb @@ -0,0 +1,13 @@ +class CollectionSnippet < ApplicationRecord + belongs_to :snippet, primary_key: 'cid', foreign_key: 'snippet_cid' + belongs_to :collection, primary_key: 'cid', foreign_key: 'collection_cid' + + scope :by_position, -> { order('position asc') } + scope :listed, -> { where.not(position: -1) } + + # We explicitly name the model here to avoid conflicts with the + # `Snippet` model having a column of the same name. + scope :published, -> do + where(collection_snippets: { date_modified: ..Date.today }) + end +end diff --git a/app/models/concerns/common_api.rb b/app/models/concerns/common_api.rb new file mode 100644 index 00000000000..ece424da1b8 --- /dev/null +++ b/app/models/concerns/common_api.rb @@ -0,0 +1,61 @@ +module CommonApi + extend ActiveSupport::Concern + + include Serializable + include Previewable + include WithCover + + included do + # Change primary key to `cid` to make `find` available + self.primary_key = :cid + + # Search by cid or slug and return the first result. + def self.[](key) + where(cid: key.sub(/^\//, '').sub(/\/$/, '')).first + end + + scope :ranked, -> { order(ranking: :desc) } + + def slug + @slug ||= cid.to_seo_slug + end + + def slug_id + @slug_id ||= slug.split('/').last + end + + def all_slugs + @all_slugs ||= Redirects.for(url).flatten + end + + # Used for serialization purposes. + def url + @url ||= is_snippet? ? slug : first_page_slug + end + + def full_url + @full_url ||= "#{Orbit::settings[:website][:url]}#{url}" + end + + def formatted_description + @formatted_description ||= description.strip_html_paragraphs_and_links + end + + def seo_description + @seo_description ||= description.strip_html + end + + # The model needs to define a `search_tokens_array` method. + def search_tokens + @search_tokens ||= search_tokens_array.join(' ') + end + + def is_snippet? + @is_snippet ||= is_a?(Snippet) + end + + def type + @type ||= self.class.name.downcase + end + end +end diff --git a/app/models/concerns/previewable.rb b/app/models/concerns/previewable.rb new file mode 100644 index 00000000000..58e82450824 --- /dev/null +++ b/app/models/concerns/previewable.rb @@ -0,0 +1,35 @@ +module Previewable + extend ActiveSupport::Concern + + included do + # Define a default previewable scope. + scope :previewable, -> { all } + + # Define a class method to store previews. + instance_variable_set(:@previews, {}) + + # Define a class method to prepare previews. + def self.prepare_previews + instance_variable_set(:@previews, previewable.map do |record| + [record.cid, record.serialize_as(:preview)] + end.to_h) + end + + # Define a class method to get a preview by cid. + def self.get_preview(cid) + instance_variable_get(:@previews)[cid] + end + + # Define an instance method to get a preview. + def preview + return @preview if defined?(@preview) + + @preview ||= self.class.get_preview(cid) || serialize_as(:preview) + end + + # Define an instance method to retrieve the preview title. + def preview_title + @preview_title ||= is_snippet? ? title : short_title + end + end +end diff --git a/app/models/concerns/serializable.rb b/app/models/concerns/serializable.rb new file mode 100644 index 00000000000..7f47b4dd45b --- /dev/null +++ b/app/models/concerns/serializable.rb @@ -0,0 +1,26 @@ +module Serializable + extend ActiveSupport::Concern + + included do + def serialize_as(serializer_class, options = {}) + serializer = + "#{serializer_class}_serializer".camelize.constantize.new( + self, options.except(:hash) + ) + if options[:hash] == true + serializer.to_h + else + serializer.as_json + end + end + + def context + @context ||= + if is_a?(Snippet) + serialize_as(:snippet_context) + else + serialize_as(:collection_context) + end + end + end +end diff --git a/app/models/concerns/with_cover.rb b/app/models/concerns/with_cover.rb new file mode 100644 index 00000000000..3a3e3f9613f --- /dev/null +++ b/app/models/concerns/with_cover.rb @@ -0,0 +1,13 @@ +module WithCover + extend ActiveSupport::Concern + + included do + delegate :cover_url, :cover_full_url, :cover_srcset, to: :cover_presenter + + private + + def cover_presenter + @cover_presenter ||= CoverPresenter.new(self) + end + end +end diff --git a/app/models/language.rb b/app/models/language.rb new file mode 100644 index 00000000000..5efaf9d1397 --- /dev/null +++ b/app/models/language.rb @@ -0,0 +1,6 @@ +class Language < ApplicationRecord + # Change primary key to `cid` to make `find` available + self.primary_key = :cid + + has_many :snippets, primary_key: 'cid', foreign_key: 'language_cid' +end diff --git a/app/models/snippet.rb b/app/models/snippet.rb new file mode 100644 index 00000000000..14b4484fe21 --- /dev/null +++ b/app/models/snippet.rb @@ -0,0 +1,163 @@ +class Snippet < ApplicationRecord + include CommonApi + + ARTICLE_MINI_PREVIEW_TAG = 'Article'.freeze + GITHUB_URL_PREFIX = 'https://github.com/Chalarangelo/30-seconds-of-code/blob/master/content/snippets'.freeze + + # Relationships + has_one :language, primary_key: 'language_cid', foreign_key: 'cid' + + has_many :collection_snippets, + class_name: 'CollectionSnippet', + foreign_key: 'snippet_cid' + + has_many :collections, + through: :collection_snippets + + # Prevent certain attributes from getting printed in the console + self.filter_attributes += [ + :description, + :content, + :table_of_contents + ] + + # TODO: Rails 7.2 will introduce this, check later + # self.attributes_for_inspect = [:id, :cid] + + scope :by_new, -> { order('date_modified desc') } + + scope :unlisted, -> { where(listed: false) } + scope :listed, -> { where(listed: true) } + + # We explicitly name the model here to avoid conflicts with the + # `CollectionSnippet` model having a column of the same name. + scope :published, -> do + where(snippets: { date_modified: ..Date.today }) + end + scope :scheduled, -> do + where.not(snippets: { date_modified: ..Date.today }) + end + + scope :previewable, -> { preload(:language) } + + def tags + @tags ||= _tags.split(';') + end + + def has_language? + @has_language ||= language_cid.present? + end + + def seo_title + return title unless has_language? + + title_language = + if language_cid == 'javascript' && primary_tag == 'node' + formatted_primary_tag + else + language.name + end + + title.include?(title_language) ? title : "#{title_language} - #{title}" + end + + def primary_tag + @primary_tag ||= tags.first + end + + def formatted_primary_tag + TagFormatter.format(primary_tag) + end + + # Used for snippet previews in search autocomplete + def formatted_mini_preview_tag + @formatted_mini_preview_tag ||= + if has_language? + language.name + else + ARTICLE_MINI_PREVIEW_TAG + end + end + + def formatted_tags + return @formatted_tags if defined?(@formatted_tags) + + @formatted_tags = tags.map { |tag| TagFormatter.format(tag) } + @formatted_tags.prepend(language.name) if has_language? + @formatted_tags = @formatted_tags.join(', ') + end + + def formatted_preview_tags + @formatted_preview_tags ||= + if has_language? + language.name + else + formatted_primary_tag + end + end + + def github_url + @github_url ||= "#{GITHUB_URL_PREFIX}#{slug}.md" + end + + def is_scheduled? + @is_scheduled ||= date_modified > Date.today + end + + def is_published? + @is_published ||= !is_scheduled? + end + + def is_listed? + @is_listed ||= listed && is_published? + end + + def date_formatted + @date_formatted ||= date_modified.strftime('%B %-d, %Y') + end + + def date_machine_formatted + @date_machine_formatted ||= date_modified.strftime('%Y-%m-%d') + end + + def search_tokens_array + @search_tokens_array ||= [ + slug_id, + *tags, + *_tokens.split(';'), + *title.normalized_tokens, + language&.short&.downcase, + language&.long&.downcase + ].compact.uniq + end + + def has_collection? + collection_snippets.present? + end + + def breadcrumbs + @breadcrumbs ||= breadcrumbs_presenter.breadcrumbs + end + + def recommended_collection + @recommended_collection ||= breadcrumbs_presenter.recommended_collection + end + + def recommended_snippets + @recommended_snippets ||= recommendation_presenter.recommend_snippets + end + + def page + @page ||= Page.from(self) + end + + private + + def breadcrumbs_presenter + @breadcrumbs_presenter ||= BreadcrumbPresenter.new(self) + end + + def recommendation_presenter + @recommendation_presenter ||= RecommendationPresenter.new(self) + end +end diff --git a/app/presenters/breadcrumb_presenter.rb b/app/presenters/breadcrumb_presenter.rb new file mode 100644 index 00000000000..cc777936e09 --- /dev/null +++ b/app/presenters/breadcrumb_presenter.rb @@ -0,0 +1,103 @@ +class BreadcrumbPresenter + attr_reader :object, :options + + delegate :collections, :primary_tag, :has_collection?, to: :object + + HOME_BREADCRUMB = { + url: '/', + name: 'Home' + }.freeze + + def initialize(object, options: {}) + @object = object + @options = options + end + + def breadcrumbs + return @breadcrumbs if defined?(@breadcrumbs) + + @breadcrumbs = [] + @breadcrumbs << HOME_BREADCRUMB + @breadcrumbs += collection_breadcrumbs + @breadcrumbs << snippet_crumb + @breadcrumbs.compact! + @breadcrumbs + end + + def recommended_collection + @recommended_collection ||= all_collections.reject do |collection| + collections_for_breadcrumbs.include?(collection) + end.max_by(&:ranking) + end + + private + + def all_collections + @all_collections ||= collections.to_a - [Collection.main, Collection.collections] + end + + def ordered_collections + return @ordered_collections if defined?(@ordered_collections) + + primary_collection = all_collections.find(&:is_primary?) + all_secondary_collections = all_collections.select(&:is_secondary?) + + main_secondary_collection = + if all_secondary_collections.present? + all_secondary_collections.find do |collection| + collection.matches_tag(primary_tag) + end + end + + secondary_collections = + all_secondary_collections - [main_secondary_collection] + + other_collections = collections - [ + Collection.main, + primary_collection, + *all_secondary_collections + ] + + @ordered_collections = [ + primary_collection, + main_secondary_collection, + *secondary_collections, + *other_collections + ].compact + end + + # TODO: There's some fiddly logic with this here, second pass please! + def collections_for_breadcrumbs + return @collections_for_breadcrumbs if defined?(@collections_for_breadcrumbs) + + @collections_for_breadcrumbs = [] + + return @collections_for_breadcrumbs unless has_collection? + + if ordered_collections.first.is_primary? + @collections_for_breadcrumbs << ordered_collections.first + end + + if ordered_collections.second.present? + @collections_for_breadcrumbs << ordered_collections.second + end + + @collections_for_breadcrumbs + end + + def collection_breadcrumbs + @collection_breadcrumbs ||= collections_for_breadcrumbs.map do |collection| + { + url: collection.first_page_slug, + name: collection.mini_title + } + end + end + + def snippet_crumb + { + url: object.slug, + name: object.short_title + } + end +end diff --git a/app/presenters/cover_presenter.rb b/app/presenters/cover_presenter.rb new file mode 100644 index 00000000000..713237a565d --- /dev/null +++ b/app/presenters/cover_presenter.rb @@ -0,0 +1,88 @@ +class CoverPresenter + attr_reader :object, :options + + COVER_EXTENSION = '.webp'.freeze + COVER_PREFIXES = { + snippet: '/assets/cover/', + collection: '/assets/splash/' + }.freeze + + COVER_SUFFIX = { + home: '-400', + snippet: '-400', + snippet_full: '-800', + collection: '-600' + }.freeze + + COVER_SIZES = { + snippet: %w(400w 800w), + snippet_full: %w(800w 400w 1200w), + collection: %w(600w 400w) + }.freeze + + def initialize(object, options: {}) + @object = object + @options = options + end + + def cover_url(full: false) + "#{cover_prefix}#{cover_name}#{cover_suffix(full: full)}#{COVER_EXTENSION}" + end + + def cover_full_url + "#{Orbit::settings[:website][:url]}#{cover_url}" + end + + def cover_srcset(full: false) + cover_sizes(full: full).map do |size| + suffix = size.delete('w') + "#{cover_prefix}#{cover_name}-#{suffix}#{COVER_EXTENSION} #{size}" + end + end + + @@all_snippet_covers = [] + + def self.all_snippet_covers + return @@all_snippet_covers if @@all_snippet_covers.any? + + @@all_snippet_covers = + Dir.entries('content/assets/cover/').slice(2..).map do |cover| + File.basename(cover, '.*') + end + end + + private + + def is_snippet? + object.is_a?(Snippet) + end + + def cover_name + # Use a symbol to support hashes, too (for home) + @cover_name ||= object[:cover] + end + + def cover_prefix + @cover_prefix ||= + is_snippet? ? COVER_PREFIXES[:snippet] : COVER_PREFIXES[:collection] + end + + def cover_sizes(full: false) + return COVER_SIZES[:collection] unless is_snippet? + + if full + COVER_SIZES[:snippet_full] + else + COVER_SIZES[:snippet] + end + end + + def cover_suffix(full: false) + # Special case for home (expects a hash) + return COVER_SUFFIX[:home] if object.is_a?(Hash) + + return COVER_SUFFIX[:collection] unless is_snippet? + + full ? COVER_SUFFIX[:snippet_full] : COVER_SUFFIX[:snippet] + end +end diff --git a/app/presenters/recommendation_presenter.rb b/app/presenters/recommendation_presenter.rb new file mode 100644 index 00000000000..c1594d37a28 --- /dev/null +++ b/app/presenters/recommendation_presenter.rb @@ -0,0 +1,172 @@ +class RecommendationPresenter + # Language + LANGUAGE_SCORE_LIMIT = 45.0 + FULL_LANGUAGE_SCORE = 45.0 + # Primary Tag + PRIMARY_TAG_SCORE_LIMIT = 15.0 + FULL_PRIMARY_TAG_SCORE = 15.0 + # Rounded up to 8 instead of 7.5 + HALF_PRIMARY_TAG_SCORE = 8.0 + # Search tokens + SEARCH_TOKEN_SCORE_LIMIT = 40.0 + # Total + # Language + Primary Tag + Search Tokens + TOTAL_SCORE_LIMIT = 100.0 + # Total without language + # Primary Tag + Search Tokens / Total + SCORE_LIMIT_WITHOUT_LANGUAGE = 0.55 + # Total without language and primary tag + # Search Tokens / Total + SCORE_LIMIT_WITHOUT_LANGUAGE_AND_PRIMARY_TAG = 0.4 + RECOMMENDATION_COUNT = 4 + + attr_reader :object, :options, :cid, :slug_id, :language_cid, :primary_tag, + :search_tokens_array, :is_listed, :search_tokens_size, + :recommendation_rankings, :min_rankings + + # Cache the recommendable snippets on the class to avoid multiple queries. + @@recommendable_snippets = nil + @@recommendable_snippets_by_language = {} + @@recommendable_snippets_by_language_and_primary_tag = {} + + # Ugly but efficient optimization strategy to first check the most relevant snippets. + def self.prepare_recommendable_snippets + @@recommendable_snippets = Snippet.preload(:language).published.ranked.group_by(&:language_cid) + + @@recommendable_snippets.each do |language_cid, snippets| + @@recommendable_snippets_by_language[language_cid] = + snippets + @@recommendable_snippets.except(language_cid).values.flatten + + @@recommendable_snippets_by_language_and_primary_tag[language_cid] = {} + + tag_grouped_snippets = snippets.group_by { |s| s.primary_tag } + tag_grouped_snippets.each do |primary_tag, primary_tag_snippets| + @@recommendable_snippets_by_language_and_primary_tag[language_cid][primary_tag] = + primary_tag_snippets + + tag_grouped_snippets.except(primary_tag).values.flatten + + @@recommendable_snippets.except(language_cid).values.flatten + end + end + + @@recommendable_snippets = @@recommendable_snippets.values.flatten + end + + def self.recommendable_snippets(language = nil, tag = nil) + prepare_recommendable_snippets if @@recommendable_snippets.blank? + + return @@recommendable_snippets if language.blank? + + return @@recommendable_snippets_by_language[language] unless tag.present? && + @@recommendable_snippets_by_language_and_primary_tag[language].key?(tag) + + @@recommendable_snippets_by_language_and_primary_tag[language][tag] + end + + def initialize(object, options: {}) + @object = object + @options = options + + @cid = object.cid + @slug_id = object.slug_id + @language_cid = object.language_cid + @primary_tag = object.primary_tag + @search_tokens_array = object.search_tokens_array + @is_listed = object.is_listed? + @search_tokens_size = @search_tokens_array.size + @recommendation_rankings = {} + @min_rankings = [] + end + + def recommend_snippets + recommendable_snippets = RecommendationPresenter.recommendable_snippets(language_cid, primary_tag) + + recommendable_snippets.each do |snippet| + # Skip if the snippet is the same as the current snippet + next if snippet.cid == cid + # Skip if the snippet is the same in another language + next if snippet.slug_id == slug_id + # Skip unless this snippet is listed or the object is unlisted + next unless !is_listed || snippet.is_listed? + + # Store the minimum ranking so far + min_ranking = min_rankings.first || 0.0 + + # Performance optimization - if language score is 0 and the minimum + # recommendation score is greater than the score limit without language, + # then we can skip the rest of the calculations. + is_same_language = snippet.language_cid == language_cid + next if !is_same_language && + min_ranking > SCORE_LIMIT_WITHOUT_LANGUAGE + + # Determine score for language: + # * Same language, as language = 100% of language score + # * Not same language = 0% of language score + language_score = is_same_language ? FULL_LANGUAGE_SCORE : 0 + + # Performance optimization - if both language and primary tag scores are + # 0 and the minimum recommendation score is greater than the score limit + # without language and primary tag, then we can skip the rest of the + # calculations. + primary_tag_index = + is_same_language ? snippet.tags.index(primary_tag) : nil + + next if !is_same_language && + primary_tag_index.blank? && + min_ranking > SCORE_LIMIT_WITHOUT_LANGUAGE_AND_PRIMARY_TAG + + # Determine primary tag score: + # * Different language = 0% of tag score + # * Same primary tag = 100% of tag score + # * Contains primary tag, but not primary = 50% of tag score + # * Doesn't contain tag = 0% of language score + primary_tag_score = + if primary_tag_index.blank? + 0 + else + primary_tag_index == 0 ? FULL_PRIMARY_TAG_SCORE : + HALF_PRIMARY_TAG_SCORE + end + + # Determine search token score: + # * Count found tokens and divide by total number of tokens + matched_tokens_count = (search_tokens_array & snippet.search_tokens_array).size + search_token_score = + (matched_tokens_count.to_f / search_tokens_size) * SEARCH_TOKEN_SCORE_LIMIT + + # Divide by the limit to get a value between 0 and 1 + recommendation_ranking = + (language_score + primary_tag_score + search_token_score).to_f / + TOTAL_SCORE_LIMIT + + # Performance optimization to minimize the number of times we have to + # sort afterwards. As soon as the minimum amount of snippets has been + # considered, we can start trimming off any snippets below the lowest + # snippet's recommendation ranking. + if recommendation_ranking > 0 + if min_rankings.size < RECOMMENDATION_COUNT + # First 4 snippets are always added + min_rankings << recommendation_ranking + else + # If the new ranking is lower than the lowest ranking, ignore it + next if recommendation_ranking < min_rankings.first + + # Otherwise, replace the lowest ranking with the new ranking + min_rankings[0] = recommendation_ranking + end + min_rankings.sort! + + recommendation_rankings[snippet.id] = [ + recommendation_ranking, snippet.ranking, snippet + ] + end + end + + recommendation_rankings. + sort do |a, b| + a[1] <=> b[1] || a[2] <=> b[2] + end. + reverse. + first(RECOMMENDATION_COUNT). + map { |s| s.last.last } + end +end diff --git a/app/presenters/sublink_presenter.rb b/app/presenters/sublink_presenter.rb new file mode 100644 index 00000000000..1bf7b48d63e --- /dev/null +++ b/app/presenters/sublink_presenter.rb @@ -0,0 +1,53 @@ +class SublinkPresenter + attr_reader :object, :options + + PARENT_TITLE = 'All'.freeze + MORE_COLLECTIONS_SUBLINK = { + title: 'More', + url: '/collections/p/1', + icon: 'arrow-right', + selected: false + }.freeze + + delegate :cid, :is_main?, :is_primary?, :has_parent?, :siblings, :children, + :root_url, to: :object + + def initialize(object, options: {}) + @object = object + @options = options + end + + def sublinks + if is_main? + return Collection. + primary. + ranked. + map { |collection| to_sublink(collection) }. + flatten. + append(MORE_COLLECTIONS_SUBLINK) + end + + return [] if !is_primary? && !has_parent? + return [] if is_primary? && children.empty? + + links = has_parent? ? siblings : children + links. + map { |link| to_sublink(link, link.cid == cid) }. + sort_by { |link| link[:title] }. + prepend({ + title: PARENT_TITLE, + url: "#{root_url}/p/1", + selected: is_primary? + }) + end + + private + + def to_sublink(collection, selected = false) + { + title: collection.mini_title, + url: collection.first_page_slug, + selected: selected + } + end +end diff --git a/app/serializers/base_serializer.rb b/app/serializers/base_serializer.rb new file mode 100644 index 00000000000..e62dfa12559 --- /dev/null +++ b/app/serializers/base_serializer.rb @@ -0,0 +1,69 @@ +# Base serialization class, based on ActiveModel::Serializers::JSON +# It allows to serialize any object with a simple DSL +# +# Example: +# class UserSerializer < BaseSerializer +# attributes :id, :name, :email +# attribute :full_name, as: :legal_name +# end +# +# user = User.new(id: 1, name: 'John', email: 'x@y.z', full_name: 'John Doe') +# +# UserSerializer.new(user).as_json +# # => { "id" => 1, "name" => "John", "email" => "x@y.z", "legal_name" => "John Doe" } +# +# See also: https://api.rubyonrails.org/classes/ActiveModel/Serialization.html +class BaseSerializer + include ActiveModel::Serializers::JSON + + # Make the object available to the serializer. + attr_accessor :object, :options + + # Initialize the serializer with an object to be serialized. + def initialize(object, options = {}) + @object = object + @options = options + end + + # Convenience method to serialize an object. + def self.serialize(object, options = {}) + new(object, options).as_json + end + + # Convenience method to serialize an array of objects. + def self.serialize_array(collection, options = {}) + collection.map { |object| serialize(object, options) } + end + + # Serialize the object into a hash with indifferent access. + def to_h + as_json.with_indifferent_access + end + + alias_method :original_as_json, :as_json + + # Override the default as_json method to camelize the keys. + # Supports only, except, root etc. + def as_json(options = nil) + json = original_as_json(options) + json.deep_transform_keys! { |key| key.to_s.camelize(:lower) } + end + + # Define behavior for inherited classes. + def self.inherited(subclass) + # Initialize the serializable attributes. + subclass.instance_variable_set(:@serializable_attributes, {}) + + # Define a class method to add attributes to the list. + subclass.define_singleton_method(:attributes) do |*fields| + fields.each do |field| + subclass.instance_variable_get(:@serializable_attributes)[field.to_s] = nil + end + end + + # Define an instance method for attribute serialization. + subclass.define_method(:attributes) do + subclass.instance_variable_get(:@serializable_attributes) + end + end +end diff --git a/app/serializers/collection_context_serializer.rb b/app/serializers/collection_context_serializer.rb new file mode 100644 index 00000000000..ee1095834c6 --- /dev/null +++ b/app/serializers/collection_context_serializer.rb @@ -0,0 +1,8 @@ +class CollectionContextSerializer < BaseSerializer + attributes :title, :content, :cover, :cover_srcset, :sublinks + + alias_attribute :cover, :cover_url + + delegate :title, :content, :cover_srcset, :sublinks, :cover_url, + to: :object +end diff --git a/app/serializers/page_serializer.rb b/app/serializers/page_serializer.rb new file mode 100644 index 00000000000..9147542c7cc --- /dev/null +++ b/app/serializers/page_serializer.rb @@ -0,0 +1,9 @@ +class PageSerializer < BaseSerializer + attributes :props, :params + + delegate :params, to: :object + + def props + object.props.merge(structured_data: object.schema_data) + end +end diff --git a/app/serializers/preview_serializer.rb b/app/serializers/preview_serializer.rb new file mode 100644 index 00000000000..4a3a3e3e7f1 --- /dev/null +++ b/app/serializers/preview_serializer.rb @@ -0,0 +1,26 @@ +class PreviewSerializer < BaseSerializer + attributes :title, :description, :url, :cover, :cover_srcset, :tags, + :extra_context, :date_time + + alias_attribute :title, :preview_title + alias_attribute :description, :formatted_description + alias_attribute :cover, :cover_url + + delegate :url, :cover_srcset, :preview_title, :formatted_description, + :cover_url, + to: :object + + COLLECTION_TAG_LITERAL = 'Collection'.freeze + + def tags + object.is_snippet? ? object.formatted_preview_tags : COLLECTION_TAG_LITERAL + end + + def extra_context + object.is_snippet? ? object.date_formatted : object.formatted_snippet_count + end + + def date_time + object.is_snippet? ? object.date_machine_formatted : nil + end +end diff --git a/app/serializers/search_result_serializer.rb b/app/serializers/search_result_serializer.rb new file mode 100644 index 00000000000..033b02e9963 --- /dev/null +++ b/app/serializers/search_result_serializer.rb @@ -0,0 +1,12 @@ +class SearchResultSerializer < BaseSerializer + attributes :title, :url, :tag, :search_tokens, :type + + alias_attribute :title, :short_title + + delegate :url, :search_tokens, :type, :short_title, + to: :object + + def tag + object.is_snippet? ? object.formatted_mini_preview_tag : object.formatted_snippet_count + end +end diff --git a/app/serializers/snippet_context_serializer.rb b/app/serializers/snippet_context_serializer.rb new file mode 100644 index 00000000000..56082be10c2 --- /dev/null +++ b/app/serializers/snippet_context_serializer.rb @@ -0,0 +1,21 @@ +class SnippetContextSerializer < BaseSerializer + attributes :title, :content, :slug, :date, :date_time, :tags, + :cover, :cover_srcset, :github_url, :table_of_contents + + alias_attribute :date, :date_formatted + alias_attribute :date_time, :date_machine_formatted + alias_attribute :tags, :formatted_tags + + delegate :title, :content, :slug, :cover_srcset, :github_url, + :table_of_contents, :date_formatted, :date_machine_formatted, + :formatted_tags, + to: :object + + def cover_srcset + object.cover_srcset(full: true) + end + + def cover + object.cover_url(full: true) + end +end diff --git a/app/views/feed/index.html.erb b/app/views/feed/index.html.erb new file mode 100644 index 00000000000..809528d7496 --- /dev/null +++ b/app/views/feed/index.html.erb @@ -0,0 +1,30 @@ + + + <%= Orbit::settings[:website][:name] %> + <%= Orbit::settings[:website][:description] %> + <%= Orbit::settings[:website][:url] %> + en-us + + <%= "#{Orbit::settings[:website][:url]}/assets/logo.png" %> + <%= Orbit::settings[:website][:name] %> + <%= Orbit::settings[:website][:url] %> + + 1440 + " rel="self" type="application/rss+xml" /> + <% nodes.each do |node| %> + + <%= node.title.escape_html %> + <%= node.full_url %> + <%= node.seo_description.escape_html %> + <%= node.date_modified.rfc2822 %> + + <% end %> + + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 00000000000..b4dfa1c8632 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Orbit + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application" %> + + + + <%= yield %> + + diff --git a/app/views/sitemap/index.html.erb b/app/views/sitemap/index.html.erb new file mode 100644 index 00000000000..1a994c2c246 --- /dev/null +++ b/app/views/sitemap/index.html.erb @@ -0,0 +1,17 @@ + + + <% urls.each do |url| %> + + <%= url %> + daily + 1.0 + + <% end %> + diff --git a/astro.config.mjs b/astro.config.mjs index 77820cb931c..408eb071900 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,5 @@ import { defineConfig } from 'astro/config'; -import settings from '#settings/global'; +import settings from '#settings'; // https://astro.build/config export default defineConfig({ @@ -8,4 +8,5 @@ export default defineConfig({ inlineStylesheets: 'always', }, compressHTML: true, + srcDir: 'astro', }); diff --git a/src/components/Breadcrumb.astro b/astro/components/Breadcrumb.astro similarity index 100% rename from src/components/Breadcrumb.astro rename to astro/components/Breadcrumb.astro diff --git a/src/components/Chips.astro b/astro/components/Chips.astro similarity index 100% rename from src/components/Chips.astro rename to astro/components/Chips.astro diff --git a/src/components/Footer.astro b/astro/components/Footer.astro similarity index 97% rename from src/components/Footer.astro rename to astro/components/Footer.astro index cb2779cc99d..fee8b38d165 100644 --- a/src/components/Footer.astro +++ b/astro/components/Footer.astro @@ -1,5 +1,5 @@ --- -import settings from '#settings/global'; +import settings from '#settings'; const currentYear = new Date().getFullYear(); --- diff --git a/src/components/Header.astro b/astro/components/Header.astro similarity index 96% rename from src/components/Header.astro rename to astro/components/Header.astro index dcffde284e7..c9c9b306243 100644 --- a/src/components/Header.astro +++ b/astro/components/Header.astro @@ -1,5 +1,5 @@ --- -import settings from '#settings/global'; +import settings from '#settings'; import Icon from '#components/Icon'; diff --git a/src/components/Hero.astro b/astro/components/Hero.astro similarity index 100% rename from src/components/Hero.astro rename to astro/components/Hero.astro diff --git a/src/components/Icon.astro b/astro/components/Icon.astro similarity index 100% rename from src/components/Icon.astro rename to astro/components/Icon.astro diff --git a/src/components/Meta.astro b/astro/components/Meta.astro similarity index 98% rename from src/components/Meta.astro rename to astro/components/Meta.astro index 6e35a693a11..95a695b64dd 100644 --- a/src/components/Meta.astro +++ b/astro/components/Meta.astro @@ -1,5 +1,5 @@ --- -import settings from '#settings/global'; +import settings from '#settings'; const { title, diff --git a/src/components/Omnisearch.astro b/astro/components/Omnisearch.astro similarity index 100% rename from src/components/Omnisearch.astro rename to astro/components/Omnisearch.astro diff --git a/src/components/Omnisearch.js b/astro/components/Omnisearch.js similarity index 98% rename from src/components/Omnisearch.js rename to astro/components/Omnisearch.js index ce75345e1ee..3d59abf94a7 100644 --- a/src/components/Omnisearch.js +++ b/astro/components/Omnisearch.js @@ -1,4 +1,4 @@ -import { quickParseTokens as tokenize } from '#utils/search'; +import { quickParseTokens as tokenize } from '#search'; const omnisearch = { openTrigger: document.querySelector('[data-open-modal="omnisearch"]'), diff --git a/src/components/Pagination.astro b/astro/components/Pagination.astro similarity index 100% rename from src/components/Pagination.astro rename to astro/components/Pagination.astro diff --git a/src/components/PreviewList.astro b/astro/components/PreviewList.astro similarity index 100% rename from src/components/PreviewList.astro rename to astro/components/PreviewList.astro diff --git a/src/components/SnippetContent.astro b/astro/components/SnippetContent.astro similarity index 89% rename from src/components/SnippetContent.astro rename to astro/components/SnippetContent.astro index e5fb3d00331..1bb0f159259 100644 --- a/src/components/SnippetContent.astro +++ b/astro/components/SnippetContent.astro @@ -11,7 +11,7 @@ const { snippet } = Astro.props; width='360' fetchpriority='high' /> - + diff --git a/src/components/TableOfContents.astro b/astro/components/TableOfContents.astro similarity index 100% rename from src/components/TableOfContents.astro rename to astro/components/TableOfContents.astro diff --git a/astro/env.d.ts b/astro/env.d.ts new file mode 100644 index 00000000000..5b0a7e0c552 --- /dev/null +++ b/astro/env.d.ts @@ -0,0 +1,2 @@ +/// +/// \ No newline at end of file diff --git a/src/layouts/Layout.astro b/astro/layouts/Layout.astro similarity index 100% rename from src/layouts/Layout.astro rename to astro/layouts/Layout.astro diff --git a/src/pages/404.astro b/astro/pages/404.astro similarity index 100% rename from src/pages/404.astro rename to astro/pages/404.astro diff --git a/src/pages/[lang]/[...listing].astro b/astro/pages/[lang]/[...listing].astro similarity index 91% rename from src/pages/[lang]/[...listing].astro rename to astro/pages/[lang]/[...listing].astro index 522c032d82f..fb71c2e38f9 100644 --- a/src/pages/[lang]/[...listing].astro +++ b/astro/pages/[lang]/[...listing].astro @@ -40,7 +40,7 @@ const { ---
diff --git a/src/pages/[lang]/s/[snippet].astro b/astro/pages/[lang]/s/[snippet].astro similarity index 100% rename from src/pages/[lang]/s/[snippet].astro rename to astro/pages/[lang]/s/[snippet].astro diff --git a/src/pages/about.astro b/astro/pages/about.astro similarity index 98% rename from src/pages/about.astro rename to astro/pages/about.astro index aacc255f319..15d40c38f68 100644 --- a/src/pages/about.astro +++ b/astro/pages/about.astro @@ -1,5 +1,5 @@ --- -import settings from '#settings/global'; +import settings from '#settings'; import Layout from '#layouts/Layout'; import Hero from '#components/Hero'; diff --git a/src/pages/faq.astro b/astro/pages/faq.astro similarity index 100% rename from src/pages/faq.astro rename to astro/pages/faq.astro diff --git a/src/pages/index.astro b/astro/pages/index.astro similarity index 100% rename from src/pages/index.astro rename to astro/pages/index.astro diff --git a/src/settings/global.js b/astro/settings.js similarity index 93% rename from src/settings/global.js rename to astro/settings.js index 771227338ef..905c5eced3a 100644 --- a/src/settings/global.js +++ b/astro/settings.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ export default { websiteName: '30 seconds of code', websiteDescription: 'Short code snippets for all your development needs', diff --git a/src/styles/_base.scss b/astro/styles/_base.scss similarity index 100% rename from src/styles/_base.scss rename to astro/styles/_base.scss diff --git a/src/styles/_code.scss b/astro/styles/_code.scss similarity index 100% rename from src/styles/_code.scss rename to astro/styles/_code.scss diff --git a/src/styles/_embed.scss b/astro/styles/_embed.scss similarity index 100% rename from src/styles/_embed.scss rename to astro/styles/_embed.scss diff --git a/src/styles/_fonts.scss b/astro/styles/_fonts.scss similarity index 100% rename from src/styles/_fonts.scss rename to astro/styles/_fonts.scss diff --git a/src/styles/_form.scss b/astro/styles/_form.scss similarity index 100% rename from src/styles/_form.scss rename to astro/styles/_form.scss diff --git a/src/styles/_layout.scss b/astro/styles/_layout.scss similarity index 100% rename from src/styles/_layout.scss rename to astro/styles/_layout.scss diff --git a/src/styles/_link.scss b/astro/styles/_link.scss similarity index 100% rename from src/styles/_link.scss rename to astro/styles/_link.scss diff --git a/src/styles/_media.scss b/astro/styles/_media.scss similarity index 100% rename from src/styles/_media.scss rename to astro/styles/_media.scss diff --git a/src/styles/_mixins.scss b/astro/styles/_mixins.scss similarity index 100% rename from src/styles/_mixins.scss rename to astro/styles/_mixins.scss diff --git a/src/styles/_scrollbar.scss b/astro/styles/_scrollbar.scss similarity index 100% rename from src/styles/_scrollbar.scss rename to astro/styles/_scrollbar.scss diff --git a/src/styles/_table.scss b/astro/styles/_table.scss similarity index 100% rename from src/styles/_table.scss rename to astro/styles/_table.scss diff --git a/src/styles/_tokens.scss b/astro/styles/_tokens.scss similarity index 100% rename from src/styles/_tokens.scss rename to astro/styles/_tokens.scss diff --git a/src/styles/_typography.scss b/astro/styles/_typography.scss similarity index 100% rename from src/styles/_typography.scss rename to astro/styles/_typography.scss diff --git a/src/styles/components/_breadcrumb.scss b/astro/styles/components/_breadcrumb.scss similarity index 100% rename from src/styles/components/_breadcrumb.scss rename to astro/styles/components/_breadcrumb.scss diff --git a/src/styles/components/_chips.scss b/astro/styles/components/_chips.scss similarity index 100% rename from src/styles/components/_chips.scss rename to astro/styles/components/_chips.scss diff --git a/src/styles/components/_expander.scss b/astro/styles/components/_expander.scss similarity index 100% rename from src/styles/components/_expander.scss rename to astro/styles/components/_expander.scss diff --git a/src/styles/components/_footer.scss b/astro/styles/components/_footer.scss similarity index 100% rename from src/styles/components/_footer.scss rename to astro/styles/components/_footer.scss diff --git a/src/styles/components/_header.scss b/astro/styles/components/_header.scss similarity index 100% rename from src/styles/components/_header.scss rename to astro/styles/components/_header.scss diff --git a/src/styles/components/_hero.scss b/astro/styles/components/_hero.scss similarity index 100% rename from src/styles/components/_hero.scss rename to astro/styles/components/_hero.scss diff --git a/src/styles/components/_omnisearch.scss b/astro/styles/components/_omnisearch.scss similarity index 100% rename from src/styles/components/_omnisearch.scss rename to astro/styles/components/_omnisearch.scss diff --git a/src/styles/components/_pagination.scss b/astro/styles/components/_pagination.scss similarity index 100% rename from src/styles/components/_pagination.scss rename to astro/styles/components/_pagination.scss diff --git a/src/styles/components/_preview-list.scss b/astro/styles/components/_preview-list.scss similarity index 100% rename from src/styles/components/_preview-list.scss rename to astro/styles/components/_preview-list.scss diff --git a/src/styles/components/_snippet-content.scss b/astro/styles/components/_snippet-content.scss similarity index 100% rename from src/styles/components/_snippet-content.scss rename to astro/styles/components/_snippet-content.scss diff --git a/src/styles/components/_table-of-contents.scss b/astro/styles/components/_table-of-contents.scss similarity index 100% rename from src/styles/components/_table-of-contents.scss rename to astro/styles/components/_table-of-contents.scss diff --git a/src/styles/components/index.scss b/astro/styles/components/index.scss similarity index 100% rename from src/styles/components/index.scss rename to astro/styles/components/index.scss diff --git a/src/styles/index.scss b/astro/styles/index.scss similarity index 100% rename from src/styles/index.scss rename to astro/styles/index.scss diff --git a/src/styles/pages/404.scss b/astro/styles/pages/404.scss similarity index 100% rename from src/styles/pages/404.scss rename to astro/styles/pages/404.scss diff --git a/src/styles/pages/index.scss b/astro/styles/pages/index.scss similarity index 100% rename from src/styles/pages/index.scss rename to astro/styles/pages/index.scss diff --git a/src/styles/pages/snippet.scss b/astro/styles/pages/snippet.scss similarity index 100% rename from src/styles/pages/snippet.scss rename to astro/styles/pages/snippet.scss diff --git a/src/scripts/deploy.sh b/bin/deploy similarity index 100% rename from src/scripts/deploy.sh rename to bin/deploy diff --git a/bin/parsley b/bin/parsley new file mode 100755 index 00000000000..ab200b12557 --- /dev/null +++ b/bin/parsley @@ -0,0 +1,36 @@ +#!/usr/bin/env node +import { Parsley } from '#parsley'; + +const args = process.argv.slice(2); + +if (args.length === 0 || args[0] === 'help') { + console.log('Usage: parsley [command]\n'); + console.log('Commands:'); + console.log(' content - Prepare content'); + console.log(' assets - Prepare assets'); + console.log(' --force, -f - Force assets preparation'); + console.log(' create [type] [directory] [name] - Create new content'); + console.log( + ' [type] - Type of content to create (snippet or collection)' + ); + console.log(' [directory] - Directory to create content in'); + console.log(' [name] - Name of content to create'); + console.log(' help - Show this help'); + process.exit(0); +} else if (args[0] === 'content') { + Parsley.prepareContent(); +} else if (args[0] === 'assets') { + const force = args[1] === '--force' || args[1] === '-f'; + Parsley.prepareAssets({ force }); +} else if (args[0] === 'create') { + if (process.argv.length < 4) { + console.log('Usage: parsley create [directory] [type] [name]'); + console.error('Not enough arguments'); + process.exit(1); + } + + Parsley.createContent(args[1], args[2], args[3]); +} else { + console.log('Invalid command'); + process.exit(1); +} diff --git a/bin/rails b/bin/rails new file mode 100755 index 00000000000..b93066a1a3d --- /dev/null +++ b/bin/rails @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby + +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000000..8dbbadb139d --- /dev/null +++ b/bin/rake @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby + +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 00000000000..e8490f753ce --- /dev/null +++ b/bin/setup @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby + +require 'fileutils' + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*) + system(*, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:prepare' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/config.ru b/config.ru new file mode 100644 index 00000000000..ad1fbf295bb --- /dev/null +++ b/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application +Rails.application.load_server diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 00000000000..3d35570ccdb --- /dev/null +++ b/config/application.rb @@ -0,0 +1,48 @@ +require_relative 'boot' + +require 'rails' +# Pick the frameworks you want: +require 'active_model/railtie' +require 'active_job/railtie' +require 'active_record/railtie' +require 'active_storage/engine' +require 'action_controller/railtie' +# require "action_mailer/railtie" +# require "action_mailbox/engine" +# require "action_text/engine" +require 'action_view/railtie' +# require "action_cable/engine" +require 'rails/test_unit/railtie' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Orbit + def self.settings(opts = nil) + @settings ||= {} + + return @settings if opts.nil? + + @settings.merge!(opts) + @settings + end + + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks core_extensions)) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 00000000000..b9e460cef32 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,4 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 00000000000..f82530cb65a --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: orbit_production diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 00000000000..55db001561f --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +mqLErt89yT0Tyx7fqy01Ode2Zfg2qxPyoHrZyHOnj6gNbftOD0uoMItX8w7bv7FpuyxQUaALT0pUozEcddkdmB6asPXiH4Clup8sxhc60ZvULPVgVUacsgSPCyYekDftsANl1uxVPZAFfSQ4EWpfpqXO3qjyXBzHgB8JObtA5iLTTJ1aZTkWyu+p1GD9Lc4pQlGy0aGFBqI5D+jo3XiFbOHLQ8ZL1Ki3IHCBYsvhg0Pzh8QIDwwXiFEG/lB5co3C9KocvpyLYd0pu/kF8XyGxKKqiWJH3vxJEHVjpMznpQjkWxb0zLS5ObyifTX2XmpzBHgkpA+DtO6o5RPMvJ8TnMW0yaRc7MvPWxmJs/HZGOlnZq0h7XwHG480NpQolETEpNhj71xkoVNrjeVEVs2ssh8FXP7t--GVSABnV/jXihfglt--irIl98h/c7YltlanbQW5tQ== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 00000000000..796466ba23e --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: storage/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: storage/test.sqlite3 + +production: + <<: *default + database: storage/production.sqlite3 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 00000000000..426333bb469 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 00000000000..007edae0ca0 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,71 @@ +require 'active_support/core_ext/integer/time' + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 00000000000..82eb5a86e11 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,91 @@ +require 'active_support/core_ext/integer/time' + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fall back to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new(STDOUT). + tap { |logger| logger.formatter = ::Logger::Formatter.new }. + then { |logger| ActiveSupport::TaggedLogging.new(logger) } + + # Prepend all log lines with the following tags. + config.log_tags = [:request_id] + + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info') + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "orbit_production" + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 00000000000..dbba5074ec1 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,57 @@ +require 'active_support/core_ext/integer/time' + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV['CI'].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/initializers/0_settings.rb b/config/initializers/0_settings.rb new file mode 100644 index 00000000000..51ed5e81484 --- /dev/null +++ b/config/initializers/0_settings.rb @@ -0,0 +1,8 @@ +# Due to the way Rails loads initializers, this file must be named with a +# number at the beginning to ensure it is loaded first. + +# Load settings defaults +require_relative '../settings/defaults.rb' + +# Load settings depending on the environment +require_relative "../settings/#{Rails.env}.rb" diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 00000000000..fe48fc34ee2 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 00000000000..b3076b38fe1 --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 00000000000..c2d89e28a28 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 00000000000..3860f659ead --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/config/initializers/load_core_extensions.rb b/config/initializers/load_core_extensions.rb new file mode 100644 index 00000000000..f3791a42d3a --- /dev/null +++ b/config/initializers/load_core_extensions.rb @@ -0,0 +1,6 @@ +# require 'core_extensions/string' +# Require all Ruby files in the core_extensions directory +Dir[Rails.root.join('lib', 'core_extensions', '*.rb')].each { |f| require f } + +# Apply the monkey patches +String.include CoreExtensions::String diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb new file mode 100644 index 00000000000..7db3b9577e6 --- /dev/null +++ b/config/initializers/permissions_policy.rb @@ -0,0 +1,13 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide HTTP permissions policy. For further +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 00000000000..6c349ae5e37 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 00000000000..e15db3e64a8 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,35 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. + +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) +min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies that the worker count should equal the number of processors in production. +if ENV['RAILS_ENV'] == 'production' + require 'concurrent-ruby' + worker_count = Integer(ENV.fetch('WEB_CONCURRENCY') { Concurrent.physical_processor_count }) + workers worker_count if worker_count > 1 +end + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development' + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch('PORT', 3000) + +# Specifies the `environment` that Puma will run in. +environment ENV.fetch('RAILS_ENV') { 'development' } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' } + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 00000000000..a125ef0850d --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,10 @@ +Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Defines the root path route ("/") + # root "posts#index" +end diff --git a/config/settings/defaults.rb b/config/settings/defaults.rb new file mode 100644 index 00000000000..e22ce81fa0e --- /dev/null +++ b/config/settings/defaults.rb @@ -0,0 +1,38 @@ +Orbit::settings website: { + name: '30 seconds of code', + short_name: '30s', + url: 'https://www.30secondsofcode.org', + description: 'Short code snippets for all your development needs', + seo_description: 'Browse %{snippet_count} short code snippets for all your development needs on %{website_name}.' +} + +Orbit::settings owner: { + name: 'Angelos Chalaris', + url: 'https://github.com/Chalarangelo' +} + +Orbit::settings repository_url: 'https://github.com/Chalarangelo/30-seconds-of-code' + +Orbit::settings license_url: 'https://creativecommons.org/licenses/by/4.0/' + +Orbit::settings manifest_cache_key: '30swp20231218115417' + +Orbit::settings cards_per_page: 24.0 +Orbit::settings collection_cards_per_page: 12.0 +Orbit::settings new_snippet_cards: 6.0 +Orbit::settings top_snippet_cards: 6.0 +Orbit::settings top_collection_chips: 8.0 + +Orbit::settings home_cover: 'work-sunrise' + +Orbit::settings content_import_path: './.content/content.json' +Orbit::settings redirects_import_path: 'content/redirects.yaml' +Orbit::settings redirects_export_path: 'public/_redirects' + +Orbit::settings page_performance_data_path: 'imported/Pages.csv' + +# This has to be the deepest nested path (snippet), so all other paths are included +Orbit::settings page_output_path: '.content/pages/[lang]/s' +Orbit::settings home_page_output_path: '.content/pages/index.json' +Orbit::settings collection_pages_output_path: '.content/pages/[lang]/[...listing].json' +Orbit::settings snippet_pages_output_path: '.content/pages/[lang]/s/[snippet].json' diff --git a/config/settings/development.rb b/config/settings/development.rb new file mode 100644 index 00000000000..e69de29bb2d diff --git a/config/settings/production.rb b/config/settings/production.rb new file mode 100644 index 00000000000..e69de29bb2d diff --git a/config/settings/test.rb b/config/settings/test.rb new file mode 100644 index 00000000000..e69de29bb2d diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 00000000000..4942ab66948 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/content/assets/icons/blog.svg b/content/assets/icons/blog.svg deleted file mode 100644 index 4bd5965a639..00000000000 --- a/content/assets/icons/blog.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/content/assets/icons/css.svg b/content/assets/icons/css.svg deleted file mode 100644 index e1e503c8477..00000000000 --- a/content/assets/icons/css.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/content/assets/icons/favicon-32x32.png b/content/assets/icons/favicon-32x32.png new file mode 100644 index 00000000000..8c6a11da7e1 Binary files /dev/null and b/content/assets/icons/favicon-32x32.png differ diff --git a/content/assets/icons/git.svg b/content/assets/icons/git.svg deleted file mode 100644 index a155d20cc55..00000000000 --- a/content/assets/icons/git.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/content/assets/icons/icon-180x180.png b/content/assets/icons/icon-180x180.png new file mode 100644 index 00000000000..bf576213f44 Binary files /dev/null and b/content/assets/icons/icon-180x180.png differ diff --git a/content/assets/icons/icon-192x192.png b/content/assets/icons/icon-192x192.png new file mode 100644 index 00000000000..088d59e1ade Binary files /dev/null and b/content/assets/icons/icon-192x192.png differ diff --git a/content/assets/icons/icon-32x32.png b/content/assets/icons/icon-32x32.png new file mode 100644 index 00000000000..8c6a11da7e1 Binary files /dev/null and b/content/assets/icons/icon-32x32.png differ diff --git a/content/assets/icons/icon-512x512.png b/content/assets/icons/icon-512x512.png new file mode 100644 index 00000000000..bc214290d49 Binary files /dev/null and b/content/assets/icons/icon-512x512.png differ diff --git a/content/assets/icons/js.svg b/content/assets/icons/js.svg deleted file mode 100644 index 28c12309746..00000000000 --- a/content/assets/icons/js.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/content/assets/icons/node.svg b/content/assets/icons/node.svg deleted file mode 100644 index f682791348b..00000000000 --- a/content/assets/icons/node.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/content/assets/icons/python.svg b/content/assets/icons/python.svg deleted file mode 100644 index a90c3d0c014..00000000000 --- a/content/assets/icons/python.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/content/assets/icons/react.svg b/content/assets/icons/react.svg deleted file mode 100644 index 5a16609148f..00000000000 --- a/content/assets/icons/react.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/content/collection-template.yaml b/content/collection-template.yaml index 97513d0462f..a51880ce4da 100644 --- a/content/collection-template.yaml +++ b/content/collection-template.yaml @@ -1,7 +1,7 @@ slug: my-collection -name: My awesome collection -shortName: My collection -featured: true +title: My awesome collection +shortTitle: My collection +listed: true snippetIds: - js/s/array-initialization - js/s/initialize-array-with-values diff --git a/content/collections/cheatsheets.yaml b/content/collections/cheatsheets.yaml index 9f2e29f1b2f..c1a793bf385 100644 --- a/content/collections/cheatsheets.yaml +++ b/content/collections/cheatsheets.yaml @@ -1,6 +1,6 @@ slug: cheatsheets -name: Cheatsheets -featured: true +title: Cheatsheets +listed: true tagMatcher: cheatsheet splash: plant-screen description: >- diff --git a/content/collections/css/animation.yaml b/content/collections/css/animation.yaml index 959652234fe..575bf80951d 100644 --- a/content/collections/css/animation.yaml +++ b/content/collections/css/animation.yaml @@ -1,7 +1,7 @@ slug: css/animation -name: CSS Animations -featured: true -miniName: Animation +title: CSS Animations +listed: true +miniTitle: Animation parent: css languageMatcher: css tagMatcher: animation diff --git a/content/collections/css/button-transitions.yaml b/content/collections/css/button-transitions.yaml index 7f1bd1e95a3..d2b515cde09 100644 --- a/content/collections/css/button-transitions.yaml +++ b/content/collections/css/button-transitions.yaml @@ -1,6 +1,6 @@ slug: css/button-transitions -name: CSS Button Transitions -featured: true +title: CSS Button Transitions +listed: true snippetIds: - css/s/button-hover-grow-animation - css/s/button-hover-shrink-animation diff --git a/content/collections/css/hover-effects.yaml b/content/collections/css/hover-effects.yaml index c2b7bb75179..fd07d68ff04 100644 --- a/content/collections/css/hover-effects.yaml +++ b/content/collections/css/hover-effects.yaml @@ -1,6 +1,6 @@ slug: css/hover-effects -name: CSS Hover Effects -featured: true +title: CSS Hover Effects +listed: true snippetIds: - css/s/image-overlay-hover - css/s/image-hover-menu diff --git a/content/collections/css/index.yaml b/content/collections/css/index.yaml index 733a8728e0f..6855c47efd5 100644 --- a/content/collections/css/index.yaml +++ b/content/collections/css/index.yaml @@ -1,9 +1,9 @@ slug: css -name: CSS Snippets -shortName: CSS +title: CSS Snippets +shortTitle: CSS topLevel: true languageMatcher: css -featured: true +listed: true description: >- The CSS snippet collection contains utilities and interactive examples for CSS3. It includes modern techniques for creating commonly-used layouts, diff --git a/content/collections/css/interactivity.yaml b/content/collections/css/interactivity.yaml index 8a02ab02e05..f5a51a222e7 100644 --- a/content/collections/css/interactivity.yaml +++ b/content/collections/css/interactivity.yaml @@ -1,8 +1,8 @@ slug: css/interactivity -name: CSS Interactivity Snippets -shortName: CSS Interactivity -miniName: Interactivity -featured: true +title: CSS Interactivity Snippets +shortTitle: CSS Interactivity +miniTitle: Interactivity +listed: true parent: css languageMatcher: css tagMatcher: interactivity diff --git a/content/collections/css/layout.yaml b/content/collections/css/layout.yaml index e3150dc0380..92ec4f3b5a8 100644 --- a/content/collections/css/layout.yaml +++ b/content/collections/css/layout.yaml @@ -1,7 +1,7 @@ slug: css/layout -name: CSS Layouts -miniName: Layout -featured: true +title: CSS Layouts +miniTitle: Layout +listed: true parent: css languageMatcher: css tagMatcher: layout diff --git a/content/collections/css/visual.yaml b/content/collections/css/visual.yaml index c03148b8794..c1bc199952c 100644 --- a/content/collections/css/visual.yaml +++ b/content/collections/css/visual.yaml @@ -1,8 +1,8 @@ slug: css/visual -name: CSS Visual Snippets -shortName: CSS Visual -miniName: Visual -featured: true +title: CSS Visual Snippets +shortTitle: CSS Visual +miniTitle: Visual +listed: true parent: css languageMatcher: css tagMatcher: visual diff --git a/content/collections/git/branch.yaml b/content/collections/git/branch.yaml index ae607e667b4..ac4b276480d 100644 --- a/content/collections/git/branch.yaml +++ b/content/collections/git/branch.yaml @@ -1,8 +1,8 @@ slug: git/branch -name: Git Branch Snippets -shortName: Git Branches -miniName: Branch -featured: true +title: Git Branch Snippets +shortTitle: Git Branches +miniTitle: Branch +listed: true parent: git languageMatcher: git tagMatcher: branch diff --git a/content/collections/git/commit.yaml b/content/collections/git/commit.yaml index 7a35e7398c6..6ded679a331 100644 --- a/content/collections/git/commit.yaml +++ b/content/collections/git/commit.yaml @@ -1,8 +1,8 @@ slug: git/commit -name: Git Commit Snippets -shortName: Git Commits -miniName: Commit -featured: true +title: Git Commit Snippets +shortTitle: Git Commits +miniTitle: Commit +listed: true parent: git languageMatcher: git tagMatcher: commit diff --git a/content/collections/git/configuration.yaml b/content/collections/git/configuration.yaml index 8bcf8c3e6af..77dbf98e261 100644 --- a/content/collections/git/configuration.yaml +++ b/content/collections/git/configuration.yaml @@ -1,8 +1,8 @@ slug: git/configuration -name: Git Configuration Snippets -shortName: Git Configuration -miniName: Configuration -featured: true +title: Git Configuration Snippets +shortTitle: Git Configuration +miniTitle: Configuration +listed: true parent: git languageMatcher: git tagMatcher: configuration diff --git a/content/collections/git/index.yaml b/content/collections/git/index.yaml index 06e05581c00..927a95d616c 100644 --- a/content/collections/git/index.yaml +++ b/content/collections/git/index.yaml @@ -1,9 +1,9 @@ slug: git -name: Git Snippets -shortName: Git +title: Git Snippets +shortTitle: Git topLevel: true languageMatcher: git -featured: true +listed: true description: >- The Git snippet collection contains a variety of short tips and tricks for all currently maintained versions of git. It includes most commonly-used commands diff --git a/content/collections/git/repository.yaml b/content/collections/git/repository.yaml index 655c6c9d09f..b6db3b20b55 100644 --- a/content/collections/git/repository.yaml +++ b/content/collections/git/repository.yaml @@ -1,8 +1,8 @@ slug: git/repository -name: Git Repository Snippets -shortName: Git Repositories -miniName: Repository -featured: true +title: Git Repository Snippets +shortTitle: Git Repositories +miniTitle: Repository +listed: true parent: git languageMatcher: git tagMatcher: repository diff --git a/content/collections/html/head-basics.yaml b/content/collections/html/head-basics.yaml index c4cf17dbe8a..f9e3dafb803 100644 --- a/content/collections/html/head-basics.yaml +++ b/content/collections/html/head-basics.yaml @@ -1,7 +1,7 @@ slug: html/head-basics -name: HTML Head Basics -miniName: Head Basics -featured: true +title: HTML Head Basics +miniTitle: Head Basics +listed: true snippetIds: - html/s/recommended-minimum-head - html/s/head-social-tags diff --git a/content/collections/html/index.yaml b/content/collections/html/index.yaml index 6acef4bcd88..f6e9831564f 100644 --- a/content/collections/html/index.yaml +++ b/content/collections/html/index.yaml @@ -1,9 +1,9 @@ slug: html -name: HTML Snippets -shortName: HTML +title: HTML Snippets +shortTitle: HTML topLevel: true languageMatcher: html -featured: true +listed: true splash: tram-car-2 description: >- The HTML snippet collection contains tips, tricks and practical code examples diff --git a/content/collections/js/algorithm.yaml b/content/collections/js/algorithm.yaml index e43462ba1bf..9de3cf6aeeb 100644 --- a/content/collections/js/algorithm.yaml +++ b/content/collections/js/algorithm.yaml @@ -1,7 +1,7 @@ slug: js/algorithm -name: JavaScript Algorithms -miniName: Algorithms -featured: true +title: JavaScript Algorithms +miniTitle: Algorithms +listed: true parent: js languageMatcher: javascript tagMatcher: algorithm diff --git a/content/collections/js/array-initialization.yaml b/content/collections/js/array-initialization.yaml index 21c0ed6d01c..2109fb2d9a7 100644 --- a/content/collections/js/array-initialization.yaml +++ b/content/collections/js/array-initialization.yaml @@ -1,6 +1,6 @@ slug: js/array-initialization -name: JavaScript Array Initialization -featured: true +title: JavaScript Array Initialization +listed: true snippetIds: - js/s/array-initialization - js/s/initialize-array-with-values diff --git a/content/collections/js/array-methods.yaml b/content/collections/js/array-methods.yaml index 2aa1e3f0e46..3cadfd9d796 100644 --- a/content/collections/js/array-methods.yaml +++ b/content/collections/js/array-methods.yaml @@ -1,6 +1,6 @@ slug: js/array-methods -name: JavaScript Array Methods -featured: true +title: JavaScript Array Methods +listed: true snippetIds: - js/s/array-map-vs-foreach - js/s/4-array-methods diff --git a/content/collections/js/array.yaml b/content/collections/js/array.yaml index 0859fbec3f2..42eecf143e2 100644 --- a/content/collections/js/array.yaml +++ b/content/collections/js/array.yaml @@ -1,8 +1,8 @@ slug: js/array -name: JavaScript Array Snippets -shortName: JavaScript Arrays -miniName: Array -featured: true +title: JavaScript Array Snippets +shortTitle: JavaScript Arrays +miniTitle: Array +listed: true parent: js languageMatcher: javascript tagMatcher: array diff --git a/content/collections/js/arrow-functions.yaml b/content/collections/js/arrow-functions.yaml index deb61de29fe..9cc5dcd09db 100644 --- a/content/collections/js/arrow-functions.yaml +++ b/content/collections/js/arrow-functions.yaml @@ -1,6 +1,6 @@ slug: js/arrow-functions -name: JavaScript Arrow Functions -featured: true +title: JavaScript Arrow Functions +listed: true snippetIds: - js/s/arrow-functions - js/s/arrow-regular-function-differences diff --git a/content/collections/js/browser.yaml b/content/collections/js/browser.yaml index a004dfcc45a..a5970161189 100644 --- a/content/collections/js/browser.yaml +++ b/content/collections/js/browser.yaml @@ -1,8 +1,8 @@ slug: js/browser -name: JavaScript Browser Snippets -shortName: JavaScript Browser -miniName: Browser -featured: true +title: JavaScript Browser Snippets +shortTitle: JavaScript Browser +miniTitle: Browser +listed: true parent: js languageMatcher: javascript tagMatcher: browser diff --git a/content/collections/js/colors.yaml b/content/collections/js/colors.yaml index dae524516ca..cba9326ba32 100644 --- a/content/collections/js/colors.yaml +++ b/content/collections/js/colors.yaml @@ -1,6 +1,6 @@ slug: js/colors -name: Colors in JavaScript -featured: true +title: Colors in JavaScript +listed: true snippetIds: - js/s/random-hex-color-code - js/s/rgb-hex-hsl-hsb-color-format-conversion diff --git a/content/collections/js/comparison.yaml b/content/collections/js/comparison.yaml index fa7244973f6..a2b4da38eed 100644 --- a/content/collections/js/comparison.yaml +++ b/content/collections/js/comparison.yaml @@ -1,6 +1,6 @@ slug: js/comparison -name: JavaScript Comparison -featured: true +title: JavaScript Comparison +listed: true snippetIds: - js/s/equality - js/s/value-not-equal-to-itself @@ -10,7 +10,7 @@ snippetIds: - js/s/object-is-triple-equals - js/s/deep-equality-comparison - js/s/match-object-properties - - js/s/function-based-object-property-matches + - js/s/match-object-properties - js/s/arrays-have-same-contents splash: succulent description: >- diff --git a/content/collections/js/css-manipulation.yaml b/content/collections/js/css-manipulation.yaml index 951ab32e28d..84ac31936c5 100644 --- a/content/collections/js/css-manipulation.yaml +++ b/content/collections/js/css-manipulation.yaml @@ -1,6 +1,6 @@ slug: js/css-manipulation -name: CSS Manipulation with JavaScript -featured: true +title: CSS Manipulation with JavaScript +listed: true snippetIds: - js/s/html-element-test-add-remove-toggle-class - js/s/get-set-add-styles-to-html-element diff --git a/content/collections/js/data-structures.yaml b/content/collections/js/data-structures.yaml index d66dcec733f..d462213b4db 100644 --- a/content/collections/js/data-structures.yaml +++ b/content/collections/js/data-structures.yaml @@ -1,8 +1,8 @@ slug: js/data-structures -name: JavaScript Data Structures -miniName: Data Structures +title: JavaScript Data Structures +miniTitle: Data Structures parent: js -featured: true +listed: true snippetIds: - js/s/native-data-structures - js/s/data-structures-queue diff --git a/content/collections/js/date.yaml b/content/collections/js/date.yaml index d5a513e32a2..dd6ac6a527b 100644 --- a/content/collections/js/date.yaml +++ b/content/collections/js/date.yaml @@ -1,8 +1,8 @@ slug: js/date -name: JavaScript Date Snippets -shortName: JavaScript Dates -miniName: Date -featured: true +title: JavaScript Date Snippets +shortTitle: JavaScript Dates +miniTitle: Date +listed: true parent: js languageMatcher: javascript tagMatcher: date diff --git a/content/collections/js/dom-manipulation.yaml b/content/collections/js/dom-manipulation.yaml index e9a085190f6..28cc502dcac 100644 --- a/content/collections/js/dom-manipulation.yaml +++ b/content/collections/js/dom-manipulation.yaml @@ -1,6 +1,6 @@ slug: js/dom-manipulation -name: JavaScript DOM Manipulation -featured: true +title: JavaScript DOM Manipulation +listed: true snippetIds: - js/s/create-html-elements - js/s/create-element diff --git a/content/collections/js/dom-querying.yaml b/content/collections/js/dom-querying.yaml index 7bd4d9d5c2b..a6ead6a6c53 100644 --- a/content/collections/js/dom-querying.yaml +++ b/content/collections/js/dom-querying.yaml @@ -1,6 +1,6 @@ slug: js/dom-querying -name: JavaScript DOM Querying -featured: true +title: JavaScript DOM Querying +listed: true snippetIds: - js/s/get-siblings - js/s/get-ancestors diff --git a/content/collections/js/event-handling.yaml b/content/collections/js/event-handling.yaml index f76ee5a1019..cdde4e7a3e4 100644 --- a/content/collections/js/event-handling.yaml +++ b/content/collections/js/event-handling.yaml @@ -1,6 +1,6 @@ slug: js/event-handling -name: JavaScript Event Handling -featured: true +title: JavaScript Event Handling +listed: true snippetIds: - js/s/add-remove-event-listener - js/s/event-listener-once diff --git a/content/collections/js/function.yaml b/content/collections/js/function.yaml index fe88c194bca..cd6f356fc75 100644 --- a/content/collections/js/function.yaml +++ b/content/collections/js/function.yaml @@ -1,7 +1,7 @@ slug: js/function -name: JavaScript Function Snippets -miniName: Function -featured: true +title: JavaScript Function Snippets +miniTitle: Function +listed: true parent: js languageMatcher: javascript tagMatcher: function diff --git a/content/collections/js/functional-programming.yaml b/content/collections/js/functional-programming.yaml index 395b2794571..f2ce2da4178 100644 --- a/content/collections/js/functional-programming.yaml +++ b/content/collections/js/functional-programming.yaml @@ -1,7 +1,7 @@ slug: js/functional-programming -name: JavaScript Functional Programming -shortName: Functional Programming -featured: true +title: JavaScript Functional Programming +shortTitle: Functional Programming +listed: true snippetIds: - js/s/functional-programming-introduction - js/s/pure-functions @@ -11,7 +11,7 @@ snippetIds: - js/s/currying - js/s/function-composition - js/s/function-arity - - js/s/partially-apply-functions + - js/s/partially-apply-function description: >- Functional programming treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. Get started with this diff --git a/content/collections/js/generators.yaml b/content/collections/js/generators.yaml index eed1ac6b4ad..9da741783d9 100644 --- a/content/collections/js/generators.yaml +++ b/content/collections/js/generators.yaml @@ -1,12 +1,11 @@ slug: js/generators -name: JavaScript Generator Functions -featured: true +title: JavaScript Generator Functions +listed: true snippetIds: - js/s/generator-for-range - js/s/range-generator - js/s/generate-values-repeatedly - js/s/generator-to-array - - js/s/is-generator-function - js/s/date-range-generator - js/s/index-of-substrings - js/s/walk-through-object @@ -14,7 +13,7 @@ snippetIds: - js/s/substring-generator - js/s/make-iterable - js/s/enum - - js/s/chunk-iterable + - js/s/split-array-into-chunks - js/s/object-array-proxy splash: generator description: >- diff --git a/content/collections/js/geometry.yaml b/content/collections/js/geometry.yaml index a45e2d58a98..0c2b26ba9b5 100644 --- a/content/collections/js/geometry.yaml +++ b/content/collections/js/geometry.yaml @@ -1,10 +1,10 @@ slug: js/geometry -name: JavaScript Geometric Operations -featured: true +title: JavaScript Geometric Operations +listed: true snippetIds: - js/s/euclidean-distance - js/s/midpoint - - js/s/vector-distance + - js/s/euclidean-distance - js/s/vector-angle splash: tea-pour description: >- diff --git a/content/collections/js/http-requests.yaml b/content/collections/js/http-requests.yaml index bcd11d62dd6..93b14458060 100644 --- a/content/collections/js/http-requests.yaml +++ b/content/collections/js/http-requests.yaml @@ -1,6 +1,6 @@ slug: js/http-requests -name: HTTP Requests in JavaScript -featured: true +title: HTTP Requests in JavaScript +listed: true snippetIds: - js/s/http-get-post-put-delete - articles/s/http-status-codes-cheatsheet diff --git a/content/collections/js/index.yaml b/content/collections/js/index.yaml index 7127184536b..0b87c94b22f 100644 --- a/content/collections/js/index.yaml +++ b/content/collections/js/index.yaml @@ -1,9 +1,9 @@ slug: js -name: JavaScript Snippets -shortName: JavaScript +title: JavaScript Snippets +shortTitle: JavaScript topLevel: true languageMatcher: javascript -featured: true +listed: true description: >- The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and diff --git a/content/collections/js/interviews.yaml b/content/collections/js/interviews.yaml index 51e4c43a297..ace2814bcf9 100644 --- a/content/collections/js/interviews.yaml +++ b/content/collections/js/interviews.yaml @@ -1,7 +1,7 @@ slug: js/interviews -name: JavaScript Interview Questions -miniName: Interview Questions -featured: true +title: JavaScript Interview Questions +miniTitle: Interview Questions +listed: true parent: js snippetIds: - js/s/equality @@ -16,7 +16,7 @@ snippetIds: - js/s/sync-async - js/s/classical-vs-prototypal-inheritance - js/s/this - - js/s/shallow-deep-clone + - js/s/shallow-deep-clone-object - js/s/copy-array - js/s/object-comparison - js/s/array-comparison diff --git a/content/collections/js/math.yaml b/content/collections/js/math.yaml index ee82d6f42f1..e20b697d5e2 100644 --- a/content/collections/js/math.yaml +++ b/content/collections/js/math.yaml @@ -1,8 +1,8 @@ slug: js/math -name: JavaScript Math Snippets -shortName: JavaScript Math -miniName: Math -featured: true +title: JavaScript Math Snippets +shortTitle: JavaScript Math +miniTitle: Math +listed: true parent: js languageMatcher: javascript tagMatcher: math diff --git a/content/collections/js/node.yaml b/content/collections/js/node.yaml index 9b3181a4d15..2d9fbcb3347 100644 --- a/content/collections/js/node.yaml +++ b/content/collections/js/node.yaml @@ -1,8 +1,8 @@ slug: js/node -name: Node.js Snippets -shortName: Node.js -miniName: Node -featured: true +title: Node.js Snippets +shortTitle: Node.js +miniTitle: Node +listed: true parent: js languageMatcher: javascript tagMatcher: node diff --git a/content/collections/js/object.yaml b/content/collections/js/object.yaml index 7dcdfc812eb..ce4d2ff27b0 100644 --- a/content/collections/js/object.yaml +++ b/content/collections/js/object.yaml @@ -1,8 +1,8 @@ slug: js/object -name: JavaScript Object Snippets -shortName: JavaScript Objects -miniName: Object -featured: true +title: JavaScript Object Snippets +shortTitle: JavaScript Objects +miniTitle: Object +listed: true parent: js languageMatcher: javascript tagMatcher: object diff --git a/content/collections/js/performance.yaml b/content/collections/js/performance.yaml index 46eadd111c7..db57549c7ef 100644 --- a/content/collections/js/performance.yaml +++ b/content/collections/js/performance.yaml @@ -1,6 +1,6 @@ slug: js/performance -name: JavaScript Performance Optimization -featured: true +title: JavaScript Performance Optimization +listed: true snippetIds: - js/s/store-dom-items - js/s/passive-scroll-listener-performance diff --git a/content/collections/js/promises.yaml b/content/collections/js/promises.yaml index abd31da5a7b..0fc838f1433 100644 --- a/content/collections/js/promises.yaml +++ b/content/collections/js/promises.yaml @@ -1,6 +1,6 @@ slug: js/promises -name: JavaScript Promises -featured: true +title: JavaScript Promises +listed: true snippetIds: - js/s/promises - js/s/async-cheatsheet diff --git a/content/collections/js/proxy.yaml b/content/collections/js/proxy.yaml index ce04ebf0032..271cd1dd6ab 100644 --- a/content/collections/js/proxy.yaml +++ b/content/collections/js/proxy.yaml @@ -1,6 +1,6 @@ slug: js/proxy -name: JavaScript Proxy -featured: true +title: JavaScript Proxy +listed: true snippetIds: - js/s/proxy-introduction - js/s/dynamic-getter-setter-proxy diff --git a/content/collections/js/random-value-generators.yaml b/content/collections/js/random-value-generators.yaml index 219e3600994..24f42f3ae4f 100644 --- a/content/collections/js/random-value-generators.yaml +++ b/content/collections/js/random-value-generators.yaml @@ -1,6 +1,6 @@ slug: js/random-value-generators -name: JavaScript Random Value Generators -featured: true +title: JavaScript Random Value Generators +listed: true snippetIds: - js/s/random-number-or-integer-in-range - js/s/random-integer-array-in-range diff --git a/content/collections/js/scroll.yaml b/content/collections/js/scroll.yaml index a9c92cb3056..bfd2916111f 100644 --- a/content/collections/js/scroll.yaml +++ b/content/collections/js/scroll.yaml @@ -1,6 +1,6 @@ slug: js/scroll -name: Browser Scrolling with JavaScript -featured: true +title: Browser Scrolling with JavaScript +listed: true snippetIds: - js/s/scroll-to-top - js/s/bottom-visible diff --git a/content/collections/js/string.yaml b/content/collections/js/string.yaml index ba2114a66b4..538115f94fe 100644 --- a/content/collections/js/string.yaml +++ b/content/collections/js/string.yaml @@ -1,7 +1,7 @@ slug: js/string -name: JavaScript String Snippets -miniName: String -featured: true +title: JavaScript String Snippets +miniTitle: String +listed: true parent: js languageMatcher: javascript tagMatcher: string diff --git a/content/collections/js/type.yaml b/content/collections/js/type.yaml index 0b65139afb4..2d7d7ac3b25 100644 --- a/content/collections/js/type.yaml +++ b/content/collections/js/type.yaml @@ -1,8 +1,8 @@ slug: js/type -name: JavaScript Type Snippets -shortName: JavaScript Types -miniName: Type -featured: true +title: JavaScript Type Snippets +shortTitle: JavaScript Types +miniTitle: Type +listed: true parent: js languageMatcher: javascript tagMatcher: type diff --git a/content/collections/js/unit-conversions.yaml b/content/collections/js/unit-conversions.yaml index 3a35ab68cd0..cf58814f5e8 100644 --- a/content/collections/js/unit-conversions.yaml +++ b/content/collections/js/unit-conversions.yaml @@ -1,6 +1,6 @@ slug: js/unit-conversions -name: JavaScript Unit Conversions -featured: true +title: JavaScript Unit Conversions +listed: true allowUnlisted: true snippetIds: - js/s/convert-degrees-radians diff --git a/content/collections/js/url.yaml b/content/collections/js/url.yaml index 7607f7bc62c..ffce1b0d3e8 100644 --- a/content/collections/js/url.yaml +++ b/content/collections/js/url.yaml @@ -1,6 +1,6 @@ slug: js/url -name: URLs in JavaScript -featured: true +title: URLs in JavaScript +listed: true snippetIds: - js/s/modify-url-without-reload - js/s/construct-url diff --git a/content/collections/js/web-storage-essentials.yaml b/content/collections/js/web-storage-essentials.yaml index a6d6b9fe570..368284855c2 100644 --- a/content/collections/js/web-storage-essentials.yaml +++ b/content/collections/js/web-storage-essentials.yaml @@ -1,6 +1,6 @@ slug: js/web-storage-essentials -name: Web Storage Essentials -featured: true +title: Web Storage Essentials +listed: true snippetIds: - js/s/cookies-local-storage-session - js/s/parse-or-serialize-cookie diff --git a/content/collections/main-listing.yaml b/content/collections/main-listing.yaml index 9aea9c310cc..2218396310d 100644 --- a/content/collections/main-listing.yaml +++ b/content/collections/main-listing.yaml @@ -1,6 +1,6 @@ slug: snippets -name: Code Snippets -featured: false +title: Code Snippets +listed: false splash: laptop-plant description: >- 30 seconds of code provides a curated collection of short code snippets for diff --git a/content/collections/python/date.yaml b/content/collections/python/date.yaml index 3d95e5a75dd..c814b2e719b 100644 --- a/content/collections/python/date.yaml +++ b/content/collections/python/date.yaml @@ -1,8 +1,8 @@ slug: python/date -name: Python Date Snippets -shortName: Python Dates -miniName: Date -featured: true +title: Python Date Snippets +shortTitle: Python Dates +miniTitle: Date +listed: true parent: python languageMatcher: python tagMatcher: date diff --git a/content/collections/python/dictionary.yaml b/content/collections/python/dictionary.yaml index c33981321b3..1d6b5b0f519 100644 --- a/content/collections/python/dictionary.yaml +++ b/content/collections/python/dictionary.yaml @@ -1,8 +1,8 @@ slug: python/dictionary -name: Python Dictionary Snippets -shortName: Python Dictionaries -miniName: Dictionary -featured: true +title: Python Dictionary Snippets +shortTitle: Python Dictionaries +miniTitle: Dictionary +listed: true parent: python languageMatcher: python tagMatcher: dictionary diff --git a/content/collections/python/function.yaml b/content/collections/python/function.yaml index ae8e9003eca..7ebac63dca1 100644 --- a/content/collections/python/function.yaml +++ b/content/collections/python/function.yaml @@ -1,8 +1,8 @@ slug: python/function -name: Python Function Snippets -shortName: Python Functions -miniName: Function -featured: true +title: Python Function Snippets +shortTitle: Python Functions +miniTitle: Function +listed: true parent: python languageMatcher: python tagMatcher: function diff --git a/content/collections/python/index.yaml b/content/collections/python/index.yaml index fa66265ec06..2f1ba3f600c 100644 --- a/content/collections/python/index.yaml +++ b/content/collections/python/index.yaml @@ -1,9 +1,9 @@ slug: python -name: Python Snippets -shortName: Python +title: Python Snippets +shortTitle: Python topLevel: true languageMatcher: python -featured: true +listed: true description: >- The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, diff --git a/content/collections/python/list.yaml b/content/collections/python/list.yaml index d6bede9758c..fceebda7711 100644 --- a/content/collections/python/list.yaml +++ b/content/collections/python/list.yaml @@ -1,8 +1,8 @@ slug: python/list -name: Python List Snippets -shortName: Python Lists -miniName: List -featured: true +title: Python List Snippets +shortTitle: Python Lists +miniTitle: List +listed: true parent: python languageMatcher: python tagMatcher: list diff --git a/content/collections/python/math.yaml b/content/collections/python/math.yaml index 906df10e9fc..242af5cee85 100644 --- a/content/collections/python/math.yaml +++ b/content/collections/python/math.yaml @@ -1,8 +1,8 @@ slug: python/math -name: Python Math Snippets -shortName: Python Math -miniName: Math -featured: true +title: Python Math Snippets +shortTitle: Python Math +miniTitle: Math +listed: true parent: python languageMatcher: python tagMatcher: math diff --git a/content/collections/python/string.yaml b/content/collections/python/string.yaml index 95c09e5974c..18b29f439af 100644 --- a/content/collections/python/string.yaml +++ b/content/collections/python/string.yaml @@ -1,8 +1,8 @@ slug: python/string -name: Python String Snippets -shortName: Python Strings -miniName: String -featured: true +title: Python String Snippets +shortTitle: Python Strings +miniTitle: String +listed: true parent: python languageMatcher: python tagMatcher: string diff --git a/content/collections/react/components.yaml b/content/collections/react/components.yaml index 8ee311ca6dc..74dfe0fd7e6 100644 --- a/content/collections/react/components.yaml +++ b/content/collections/react/components.yaml @@ -1,7 +1,7 @@ slug: react/components -name: React Components -miniName: Components -featured: true +title: React Components +miniTitle: Components +listed: true parent: react languageMatcher: react tagMatcher: components diff --git a/content/collections/react/hooks.yaml b/content/collections/react/hooks.yaml index 045356f635e..57408ab40f8 100644 --- a/content/collections/react/hooks.yaml +++ b/content/collections/react/hooks.yaml @@ -1,7 +1,7 @@ slug: react/hooks -name: React Hooks -miniName: Hooks -featured: true +title: React Hooks +miniTitle: Hooks +listed: true parent: react languageMatcher: react tagMatcher: hooks diff --git a/content/collections/react/index.yaml b/content/collections/react/index.yaml index d64b6e11e60..6d53d8b9bbe 100644 --- a/content/collections/react/index.yaml +++ b/content/collections/react/index.yaml @@ -1,9 +1,9 @@ slug: react -name: React Snippets -shortName: React +title: React Snippets +shortTitle: React topLevel: true languageMatcher: react -featured: true +listed: true description: >- The React snippet collection contains function components and reusable hooks for React 18. diff --git a/content/collections/react/rendering.yaml b/content/collections/react/rendering.yaml index 389bc920b98..67004f95e60 100644 --- a/content/collections/react/rendering.yaml +++ b/content/collections/react/rendering.yaml @@ -1,8 +1,8 @@ slug: react/rendering -name: React Rendering -miniName: Rendering +title: React Rendering +miniTitle: Rendering parent: react -featured: true +listed: true snippetIds: - react/s/rendering-basics - react/s/rendering-optimization diff --git a/content/collections/react/testing.yaml b/content/collections/react/testing.yaml index 653ebd5494b..5332789332f 100644 --- a/content/collections/react/testing.yaml +++ b/content/collections/react/testing.yaml @@ -1,9 +1,9 @@ slug: react/testing -name: React Testing -shortName: React Testing -miniName: Testing +title: React Testing +shortTitle: React Testing +miniTitle: Testing parent: react -featured: true +listed: true snippetIds: - react/s/testing-stateful-ui-components - react/s/testing-async-components diff --git a/content/collections/webdev.yaml b/content/collections/webdev.yaml index 65f7afb6857..b8b20839afe 100644 --- a/content/collections/webdev.yaml +++ b/content/collections/webdev.yaml @@ -1,6 +1,6 @@ slug: web-development -name: Web development Snippets -shortName: Web development +title: Web development Snippets +shortTitle: Web development tagMatcher: webdev description: >- The web development snippet collection contains curated stories, tips, diff --git a/content/hub.yaml b/content/hub.yaml index 956621d4ccc..e187d6f729e 100644 --- a/content/hub.yaml +++ b/content/hub.yaml @@ -1,4 +1,5 @@ -name: Snippet Collections +slug: collections +title: Snippet Collections splash: widescreen description: >- 30 seconds of code provides a wide variety of snippet and article diff --git a/content/snippets/articles/s/4-seo-tips-for-developers.md b/content/snippets/articles/s/4-seo-tips-for-developers.md index df9bf97e034..aa5738e4f42 100644 --- a/content/snippets/articles/s/4-seo-tips-for-developers.md +++ b/content/snippets/articles/s/4-seo-tips-for-developers.md @@ -5,6 +5,7 @@ type: story tags: [webdev,seo] cover: sunrise-over-city excerpt: SEO is a very relevant topics that most developers are inexperienced in. Here are 4 actionable SEO tips you can implement today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/articles/s/7-chrome-extensions-for-web-developers.md b/content/snippets/articles/s/7-chrome-extensions-for-web-developers.md index 83ef2b4d9d9..e11c3ac4d12 100644 --- a/content/snippets/articles/s/7-chrome-extensions-for-web-developers.md +++ b/content/snippets/articles/s/7-chrome-extensions-for-web-developers.md @@ -5,7 +5,7 @@ type: story tags: [webdev,devtools] cover: computer-screens excerpt: Boost your productivity with 7 must-have Google Chrome developer tool extensions. -unlisted: true +listed: false dateModified: 2021-06-12 --- diff --git a/content/snippets/articles/s/8-tips-for-remote-work.md b/content/snippets/articles/s/8-tips-for-remote-work.md index 57c5b0b330f..93e223d75c8 100644 --- a/content/snippets/articles/s/8-tips-for-remote-work.md +++ b/content/snippets/articles/s/8-tips-for-remote-work.md @@ -4,7 +4,7 @@ type: story tags: [webdev,career,programming,jobs] cover: kettle-laptop excerpt: Working from home seems great compared to going to the office, but there are challenges that come with it that you need to overcome. -unlisted: true +listed: false dateModified: 2021-06-12 --- diff --git a/content/snippets/articles/s/avoiding-bad-advice.md b/content/snippets/articles/s/avoiding-bad-advice.md index 7447d48d527..9e1283703be 100644 --- a/content/snippets/articles/s/avoiding-bad-advice.md +++ b/content/snippets/articles/s/avoiding-bad-advice.md @@ -5,6 +5,7 @@ type: story tags: [webdev,career,programming] cover: inside-weather excerpt: Don't fall victim to bad advice! Learn to identify "senior juniorism", and develop critical thinking to make better coding decisions. +listed: true dateModified: 2023-06-04 --- diff --git a/content/snippets/articles/s/bash-alias-dollar-sign.md b/content/snippets/articles/s/bash-alias-dollar-sign.md index 57eeb48e60a..d0b040e90e5 100644 --- a/content/snippets/articles/s/bash-alias-dollar-sign.md +++ b/content/snippets/articles/s/bash-alias-dollar-sign.md @@ -6,6 +6,7 @@ language: git tags: [configuration] cover: capsule-coffee excerpt: Learn how to eliminate the annoyance of copying dollar signs ($) along with terminal commands from the web with a simple bash alias. +listed: true dateModified: 2023-03-05 --- diff --git a/content/snippets/articles/s/benefits-of-writing.md b/content/snippets/articles/s/benefits-of-writing.md index 9ff24bb9eab..6ef30e3da45 100644 --- a/content/snippets/articles/s/benefits-of-writing.md +++ b/content/snippets/articles/s/benefits-of-writing.md @@ -4,6 +4,7 @@ type: story tags: [webdev,career,programming,jobs] cover: laptop-view excerpt: Writing about a topic can often sound boring or worthless. But there are significant benefits to doing it from time to time. +listed: true dateModified: 2022-11-05 --- diff --git a/content/snippets/articles/s/dns-record-basics.md b/content/snippets/articles/s/dns-record-basics.md index 4149d3db860..5dc98d7981e 100644 --- a/content/snippets/articles/s/dns-record-basics.md +++ b/content/snippets/articles/s/dns-record-basics.md @@ -5,6 +5,7 @@ type: cheatsheet tags: [webdev,dns,server,cheatsheet] cover: sparkles excerpt: DNS records may not be something you work with frequently, but having a basic understanding can be highly beneficial. +listed: true dateModified: 2022-01-09 --- diff --git a/content/snippets/articles/s/escaping-tutorial-hell.md b/content/snippets/articles/s/escaping-tutorial-hell.md index 82caf650cf9..abc8d76fbfa 100644 --- a/content/snippets/articles/s/escaping-tutorial-hell.md +++ b/content/snippets/articles/s/escaping-tutorial-hell.md @@ -4,6 +4,7 @@ type: story tags: [webdev,career,programming,jobs] cover: campfire excerpt: Many beginners get stuck in tutorial hell without even realizing. Here are 4 simple ways to escape tutorial hell and get back to learning. +listed: true dateModified: 2022-05-26 --- diff --git a/content/snippets/articles/s/http-status-codes-cheatsheet.md b/content/snippets/articles/s/http-status-codes-cheatsheet.md index 2814bbdbcfc..e0c26ea742e 100644 --- a/content/snippets/articles/s/http-status-codes-cheatsheet.md +++ b/content/snippets/articles/s/http-status-codes-cheatsheet.md @@ -5,6 +5,7 @@ type: cheatsheet tags: [webdev,http,cheatsheet] cover: hiking-walking excerpt: Familiarize yourself with the most common HTTP status codes with this handy cheatsheet. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/articles/s/technical-debt.md b/content/snippets/articles/s/technical-debt.md index aeae40840e3..f4851d8a097 100644 --- a/content/snippets/articles/s/technical-debt.md +++ b/content/snippets/articles/s/technical-debt.md @@ -4,6 +4,7 @@ type: story tags: [webdev,career,programming,management] cover: new-york excerpt: Learn what technical debt is, its causes and symptoms, and how to deal with it. +listed: true dateModified: 2022-10-09 --- diff --git a/content/snippets/articles/s/terminal-shortcuts-cheatsheet.md b/content/snippets/articles/s/terminal-shortcuts-cheatsheet.md index 9198dce3223..a1403ad7045 100644 --- a/content/snippets/articles/s/terminal-shortcuts-cheatsheet.md +++ b/content/snippets/articles/s/terminal-shortcuts-cheatsheet.md @@ -4,6 +4,7 @@ type: cheatsheet tags: [webdev,bash,cheatsheet] cover: terminal excerpt: Maximize your productivity when working with a bash or other shell terminal by using these keyboard shortcuts. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/articles/snippet-template.md b/content/snippets/articles/snippet-template.md index 0662b553a2c..c1420072d20 100644 --- a/content/snippets/articles/snippet-template.md +++ b/content/snippets/articles/snippet-template.md @@ -6,6 +6,7 @@ language: javascript tags: [webdev] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/css/s/10-css-background-patterns.md b/content/snippets/css/s/10-css-background-patterns.md index 06d61e8d155..d5e06c5f15f 100644 --- a/content/snippets/css/s/10-css-background-patterns.md +++ b/content/snippets/css/s/10-css-background-patterns.md @@ -6,6 +6,7 @@ language: css tags: [visual,cheatsheet] cover: armchair-design excerpt: I hand picked 10 of my favorite CSS background patterns from MagicPattern for your next project. Get them now! +listed: true dateModified: 2024-05-09 --- diff --git a/content/snippets/css/s/25-css-gradients.md b/content/snippets/css/s/25-css-gradients.md index 1492ce50366..5daba767d65 100644 --- a/content/snippets/css/s/25-css-gradients.md +++ b/content/snippets/css/s/25-css-gradients.md @@ -6,6 +6,7 @@ language: css tags: [visual,cheatsheet] cover: colors-mural excerpt: I hand picked 25 of my favorite CSS gradients from uiGradients for your next design. Get them now! +listed: true dateModified: 2024-01-12 --- diff --git a/content/snippets/css/s/alternating-text.md b/content/snippets/css/s/alternating-text.md index 9778422d831..ff3e284e687 100644 --- a/content/snippets/css/s/alternating-text.md +++ b/content/snippets/css/s/alternating-text.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: italian-horizon +excerpt: Creates an alternating text animation. +listed: true dateModified: 2023-05-25 --- diff --git a/content/snippets/css/s/aspect-ratio.md b/content/snippets/css/s/aspect-ratio.md index 5bdfe461c2a..712a08ec6d8 100644 --- a/content/snippets/css/s/aspect-ratio.md +++ b/content/snippets/css/s/aspect-ratio.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: digital-nomad-12 +excerpt: Creates a responsive container with a specified aspect ratio. +listed: true dateModified: 2022-08-14 --- diff --git a/content/snippets/css/s/border-with-top-triangle.md b/content/snippets/css/s/border-with-top-triangle.md index 290883864c1..6ae3f50a662 100644 --- a/content/snippets/css/s/border-with-top-triangle.md +++ b/content/snippets/css/s/border-with-top-triangle.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: greek-coffee +excerpt: Creates a content container with a triangle at the top. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/css/s/bouncing-loader.md b/content/snippets/css/s/bouncing-loader.md index 699b79039fb..2c7547bc8c8 100644 --- a/content/snippets/css/s/bouncing-loader.md +++ b/content/snippets/css/s/bouncing-loader.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: digital-nomad-12 +excerpt: Creates a bouncing loader animation. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/box-sizing-reset.md b/content/snippets/css/s/box-sizing-reset.md index 9fffa417c12..5f5757938a4 100644 --- a/content/snippets/css/s/box-sizing-reset.md +++ b/content/snippets/css/s/box-sizing-reset.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: interior +excerpt: Resets the box-model so that `width` and `height` are not affected by `border` or `padding`. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/broken-image-fallback.md b/content/snippets/css/s/broken-image-fallback.md index 962071d9373..f649c1cac15 100644 --- a/content/snippets/css/s/broken-image-fallback.md +++ b/content/snippets/css/s/broken-image-fallback.md @@ -5,6 +5,8 @@ shortTitle: Broken image fallback language: css tags: [visual] cover: building-facade +excerpt: Displays an error message when an image fails to load. +listed: true dateModified: 2022-11-04 --- diff --git a/content/snippets/css/s/button-border-animation.md b/content/snippets/css/s/button-border-animation.md index 9e7d164b779..9658db6fe97 100644 --- a/content/snippets/css/s/button-border-animation.md +++ b/content/snippets/css/s/button-border-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: highlands +excerpt: Creates a border animation on hover. +listed: true dateModified: 2021-05-24 --- diff --git a/content/snippets/css/s/button-focus-swing-animation.md b/content/snippets/css/s/button-focus-swing-animation.md index d659cd16c2c..10bd4c2b6bf 100644 --- a/content/snippets/css/s/button-focus-swing-animation.md +++ b/content/snippets/css/s/button-focus-swing-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: painters-desk +excerpt: Creates a swing animation on focus. +listed: true dateModified: 2021-05-24 --- diff --git a/content/snippets/css/s/button-hover-fill-animation.md b/content/snippets/css/s/button-hover-fill-animation.md index ae6da55accc..f27314feef0 100644 --- a/content/snippets/css/s/button-hover-fill-animation.md +++ b/content/snippets/css/s/button-hover-fill-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: beach-pineapple +excerpt: Creates a fill animation on hover. +listed: true dateModified: 2021-04-02 --- diff --git a/content/snippets/css/s/button-hover-grow-animation.md b/content/snippets/css/s/button-hover-grow-animation.md index b599f3e885e..5d653300fb7 100644 --- a/content/snippets/css/s/button-hover-grow-animation.md +++ b/content/snippets/css/s/button-hover-grow-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: white-laptop +excerpt: Creates a grow animation on hover. +listed: true dateModified: 2021-05-24 --- diff --git a/content/snippets/css/s/button-hover-shrink-animation.md b/content/snippets/css/s/button-hover-shrink-animation.md index 0d4de631a02..ef637d90b43 100644 --- a/content/snippets/css/s/button-hover-shrink-animation.md +++ b/content/snippets/css/s/button-hover-shrink-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: clay-pot-horizon +excerpt: Creates a shrink animation on hover. +listed: true dateModified: 2021-05-24 --- diff --git a/content/snippets/css/s/card-image-cutout.md b/content/snippets/css/s/card-image-cutout.md index eb625bba5ae..bc55bca64b0 100644 --- a/content/snippets/css/s/card-image-cutout.md +++ b/content/snippets/css/s/card-image-cutout.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: radio-monstera +excerpt: Creates a card with an image cutout. +listed: true dateModified: 2022-12-11 --- diff --git a/content/snippets/css/s/centering.md b/content/snippets/css/s/centering.md index 6353bf20003..1cdb1a38ed5 100644 --- a/content/snippets/css/s/centering.md +++ b/content/snippets/css/s/centering.md @@ -5,6 +5,7 @@ language: css tags: [layout] cover: malibu excerpt: Centering content with CSS might often feel difficult. Here are 4 easy ways you can do it. +listed: true dateModified: 2024-05-07 --- diff --git a/content/snippets/css/s/circular-progress-bar.md b/content/snippets/css/s/circular-progress-bar.md index 10a8be22f3c..a7a2a2d0a9c 100644 --- a/content/snippets/css/s/circular-progress-bar.md +++ b/content/snippets/css/s/circular-progress-bar.md @@ -6,6 +6,7 @@ language: css tags: [visual,animation] cover: clouds-over-mountains excerpt: Circular progress bars are fairly common in the web. Luckily, some new CSS features make it easier than ever to create them. +listed: true dateModified: 2023-12-23 --- diff --git a/content/snippets/css/s/clamp.md b/content/snippets/css/s/clamp.md index be9266c6ca3..f0ddb4abe8d 100644 --- a/content/snippets/css/s/clamp.md +++ b/content/snippets/css/s/clamp.md @@ -6,6 +6,7 @@ language: css tags: [visual] cover: strawberries excerpt: Implement responsive typography with the CSS clamp() function. +listed: true dateModified: 2022-12-28 --- diff --git a/content/snippets/css/s/clearfix.md b/content/snippets/css/s/clearfix.md index 81a0a355415..66525578574 100644 --- a/content/snippets/css/s/clearfix.md +++ b/content/snippets/css/s/clearfix.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: memories-of-pineapple-3 +excerpt: Ensures that an element self-clears its children. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/code-reviews.md b/content/snippets/css/s/code-reviews.md index a6841867a2e..0c435e7ecf3 100644 --- a/content/snippets/css/s/code-reviews.md +++ b/content/snippets/css/s/code-reviews.md @@ -6,6 +6,7 @@ language: css tags: [webdev] cover: green-css excerpt: Reviewing CSS code is a skill that takes time to master. Here are some tips from my personal experience to help you get started. +listed: true dateModified: 2023-05-21 --- diff --git a/content/snippets/css/s/constant-width-to-height-ratio.md b/content/snippets/css/s/constant-width-to-height-ratio.md index 9b92f8665a7..fb0746b7ade 100644 --- a/content/snippets/css/s/constant-width-to-height-ratio.md +++ b/content/snippets/css/s/constant-width-to-height-ratio.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: clutter +excerpt: Ensures that an element with variable `width` will retain a proportionate `height` value. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/counter.md b/content/snippets/css/s/counter.md index 1b047111891..5bd016371d6 100644 --- a/content/snippets/css/s/counter.md +++ b/content/snippets/css/s/counter.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: dark-leaves-2 +excerpt: Creates a custom list counter that accounts for nested list elements. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/current-color.md b/content/snippets/css/s/current-color.md index 01cd5144d7b..ce72390d2be 100644 --- a/content/snippets/css/s/current-color.md +++ b/content/snippets/css/s/current-color.md @@ -5,6 +5,7 @@ language: css tags: [visual] cover: picking-berries excerpt: The `currentColor` CSS keyword is a nifty alternative to custom properties for simple use cases. +listed: true dateModified: 2022-11-30 --- diff --git a/content/snippets/css/s/custom-checkbox.md b/content/snippets/css/s/custom-checkbox.md index 3ee52b39496..8e5150b33ad 100644 --- a/content/snippets/css/s/custom-checkbox.md +++ b/content/snippets/css/s/custom-checkbox.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,animation] cover: interior-8 +excerpt: Creates a styled checkbox with animation on state change. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/custom-radio.md b/content/snippets/css/s/custom-radio.md index a154cad1b1e..2526fb67729 100644 --- a/content/snippets/css/s/custom-radio.md +++ b/content/snippets/css/s/custom-radio.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,animation] cover: messy-computer +excerpt: Creates a styled radio button with animation on state change. +listed: true dateModified: 2022-11-16 --- diff --git a/content/snippets/css/s/custom-scrollbar.md b/content/snippets/css/s/custom-scrollbar.md index b1ffcce6591..2ecfd7d7086 100644 --- a/content/snippets/css/s/custom-scrollbar.md +++ b/content/snippets/css/s/custom-scrollbar.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: sea-view +excerpt: Customizes the scrollbar style for elements with scrollable overflow. +listed: true dateModified: 2021-05-16 --- diff --git a/content/snippets/css/s/custom-text-selection.md b/content/snippets/css/s/custom-text-selection.md index b2fd64a51b7..3285600f461 100644 --- a/content/snippets/css/s/custom-text-selection.md +++ b/content/snippets/css/s/custom-text-selection.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: digital-nomad +excerpt: Changes the styling of text selection. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/disable-selection.md b/content/snippets/css/s/disable-selection.md index 5a5507fb4a4..6011ab306b2 100644 --- a/content/snippets/css/s/disable-selection.md +++ b/content/snippets/css/s/disable-selection.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: interior-9 +excerpt: Makes the content unselectable. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/display-empty-links.md b/content/snippets/css/s/display-empty-links.md index fe2b8bb934f..1e05893b041 100644 --- a/content/snippets/css/s/display-empty-links.md +++ b/content/snippets/css/s/display-empty-links.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: metro-tunnel +excerpt: Displays the link URL for links with no text. +listed: true dateModified: 2022-11-11 --- diff --git a/content/snippets/css/s/donut-spinner.md b/content/snippets/css/s/donut-spinner.md index 6548ce042b6..3e09d90c068 100644 --- a/content/snippets/css/s/donut-spinner.md +++ b/content/snippets/css/s/donut-spinner.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: digital-nomad-3 +excerpt: Creates a donut spinner that can be used to indicate the loading of content. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/drop-cap.md b/content/snippets/css/s/drop-cap.md index 9cce93369b8..b05e8ed4d52 100644 --- a/content/snippets/css/s/drop-cap.md +++ b/content/snippets/css/s/drop-cap.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: bamboo-lamp +excerpt: Makes the first letter of the first paragraph bigger than the rest of the text. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/dynamic-shadow.md b/content/snippets/css/s/dynamic-shadow.md index d16b561cb8d..9efddfd9cfb 100644 --- a/content/snippets/css/s/dynamic-shadow.md +++ b/content/snippets/css/s/dynamic-shadow.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: couch-laptop +excerpt: Creates a shadow similar to `box-shadow` but based on the colors of the element itself. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/easing-variables.md b/content/snippets/css/s/easing-variables.md index 713ad4f05da..30ce090a7c6 100644 --- a/content/snippets/css/s/easing-variables.md +++ b/content/snippets/css/s/easing-variables.md @@ -5,6 +5,7 @@ language: css tags: [animation] cover: curve excerpt: Learn how to use the `cubic-bezier()` class of easing functions and create beautiful animations that stand out. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/css/s/etched-text.md b/content/snippets/css/s/etched-text.md index 61e8651e2d9..07438963e91 100644 --- a/content/snippets/css/s/etched-text.md +++ b/content/snippets/css/s/etched-text.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: memories-of-pineapple-2 +excerpt: Creates an effect where text appears to be "etched" or engraved into the background. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/evenly-distributed-children.md b/content/snippets/css/s/evenly-distributed-children.md index a1f768f04e5..4547bdf73fa 100644 --- a/content/snippets/css/s/evenly-distributed-children.md +++ b/content/snippets/css/s/evenly-distributed-children.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: little-bird +excerpt: Evenly distributes child elements within a parent element. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/fit-image-in-container.md b/content/snippets/css/s/fit-image-in-container.md index 1a7e5f747bc..a83cc470de6 100644 --- a/content/snippets/css/s/fit-image-in-container.md +++ b/content/snippets/css/s/fit-image-in-container.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout,visual] cover: succulent-3 +excerpt: Fits an positions an image appropriately inside its container while preserving its aspect ratio. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/flexbox-cheatsheet.md b/content/snippets/css/s/flexbox-cheatsheet.md index c6830449bb2..a2048bace71 100644 --- a/content/snippets/css/s/flexbox-cheatsheet.md +++ b/content/snippets/css/s/flexbox-cheatsheet.md @@ -5,6 +5,7 @@ language: css tags: [layout,flexbox,cheatsheet] cover: frames excerpt: Flexbox allows you to create fluid layouts easily. If you are constantly looking up how it works, this handy cheatsheet is all you need. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/css/s/floating-list-titles.md b/content/snippets/css/s/floating-list-titles.md index f8d1f002385..a7529d1491a 100644 --- a/content/snippets/css/s/floating-list-titles.md +++ b/content/snippets/css/s/floating-list-titles.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: pop-of-green +excerpt: Creates a list with floating headings for each section. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/fluid-typography.md b/content/snippets/css/s/fluid-typography.md index 276e4235837..91eaf2ac338 100644 --- a/content/snippets/css/s/fluid-typography.md +++ b/content/snippets/css/s/fluid-typography.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: shell-focus +excerpt: Creates text that scales according to the viewport width. +listed: true dateModified: 2021-05-16 --- diff --git a/content/snippets/css/s/focus-within.md b/content/snippets/css/s/focus-within.md index 285b583efbe..d5f1efdd32f 100644 --- a/content/snippets/css/s/focus-within.md +++ b/content/snippets/css/s/focus-within.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,interactivity] cover: boats +excerpt: Changes the appearance of a form if any of its children are focused. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/footer-at-the-bottom.md b/content/snippets/css/s/footer-at-the-bottom.md index 0655e410a60..79517c959c1 100644 --- a/content/snippets/css/s/footer-at-the-bottom.md +++ b/content/snippets/css/s/footer-at-the-bottom.md @@ -6,6 +6,7 @@ language: css tags: [layout] cover: flower-shape-sunset excerpt: Make sure the footer stays at the bottom of the page, instead of floating up when the content is too short. +listed: true dateModified: 2022-10-30 --- diff --git a/content/snippets/css/s/full-width.md b/content/snippets/css/s/full-width.md index 5b0c9be26bf..547d20378ee 100644 --- a/content/snippets/css/s/full-width.md +++ b/content/snippets/css/s/full-width.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: yellow-white-mug-2 +excerpt: Creates a full-width image. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/css/s/fullscreen.md b/content/snippets/css/s/fullscreen.md index 4029cfb0563..1f806f7c927 100644 --- a/content/snippets/css/s/fullscreen.md +++ b/content/snippets/css/s/fullscreen.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: flower-portrait-3 +excerpt: Applies styles to an element when in fullscreen mode. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/gradient-text.md b/content/snippets/css/s/gradient-text.md index 42c6d444869..be9e299a754 100644 --- a/content/snippets/css/s/gradient-text.md +++ b/content/snippets/css/s/gradient-text.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: red-berries +excerpt: Gives text a gradient color. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/hamburger-button.md b/content/snippets/css/s/hamburger-button.md index 86e3ef049d6..8f915663503 100644 --- a/content/snippets/css/s/hamburger-button.md +++ b/content/snippets/css/s/hamburger-button.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: volcano-sunset +excerpt: Displays a hamburger menu which transitions to a cross button on hover. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/height-transition.md b/content/snippets/css/s/height-transition.md index 1c428cbc6f5..cab1d1fb4ff 100644 --- a/content/snippets/css/s/height-transition.md +++ b/content/snippets/css/s/height-transition.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: washed-ashore +excerpt: Transitions an element's height from `0` to `auto` when its height is unknown. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/hide-empty-elements.md b/content/snippets/css/s/hide-empty-elements.md index 0d9ee249a01..db96ffb5cb3 100644 --- a/content/snippets/css/s/hide-empty-elements.md +++ b/content/snippets/css/s/hide-empty-elements.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: metro-arrival +excerpt: Hides elements with no content. +listed: true dateModified: 2022-11-18 --- diff --git a/content/snippets/css/s/hide-scrollbars.md b/content/snippets/css/s/hide-scrollbars.md index 44d3197694f..dd8d6265352 100644 --- a/content/snippets/css/s/hide-scrollbars.md +++ b/content/snippets/css/s/hide-scrollbars.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: by-the-lighthouse +excerpt: Hides scrollbars on an element, while still allowing it to be scrollable. +listed: true dateModified: 2022-05-13 --- diff --git a/content/snippets/css/s/horizontal-gallery.md b/content/snippets/css/s/horizontal-gallery.md index 719313a240e..1da15935505 100644 --- a/content/snippets/css/s/horizontal-gallery.md +++ b/content/snippets/css/s/horizontal-gallery.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,interactivity] cover: flower-portrait-5 +excerpt: Creates a horizontally scrollable image gallery. +listed: true dateModified: 2022-05-01 --- diff --git a/content/snippets/css/s/horizontal-scroll-snap.md b/content/snippets/css/s/horizontal-scroll-snap.md index c264e9b4152..b46ec6793c0 100644 --- a/content/snippets/css/s/horizontal-scroll-snap.md +++ b/content/snippets/css/s/horizontal-scroll-snap.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: waves-from-above +excerpt: Creates a horizontally scrollable container that will snap on elements when scrolling. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/hover-additional-content.md b/content/snippets/css/s/hover-additional-content.md index 2fa9aeac514..165f23ce6c9 100644 --- a/content/snippets/css/s/hover-additional-content.md +++ b/content/snippets/css/s/hover-additional-content.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: dark-leaves-5 +excerpt: Creates a card that displays additional content on hover. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/hover-perspective.md b/content/snippets/css/s/hover-perspective.md index 5d1738ebf9f..162eaf00074 100644 --- a/content/snippets/css/s/hover-perspective.md +++ b/content/snippets/css/s/hover-perspective.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: shiny-mountains +excerpt: Applies a perspective transform with a hover animation to an element. +listed: true dateModified: 2021-05-17 --- diff --git a/content/snippets/css/s/hover-shadow-box-animation.md b/content/snippets/css/s/hover-shadow-box-animation.md index fd7c4388b38..6ebac6c6dea 100644 --- a/content/snippets/css/s/hover-shadow-box-animation.md +++ b/content/snippets/css/s/hover-shadow-box-animation.md @@ -3,8 +3,9 @@ title: Hover shadow box animation type: snippet language: css tags: [animation] -unlisted: true cover: dark-cloud +excerpt: Creates a shadow box around the text when it is hovered. +listed: false dateModified: 2021-01-04 --- diff --git a/content/snippets/css/s/hover-underline-animation.md b/content/snippets/css/s/hover-underline-animation.md index 2e48cd42d4a..63d6e34f26d 100644 --- a/content/snippets/css/s/hover-underline-animation.md +++ b/content/snippets/css/s/hover-underline-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: coffee-phone-tray-2 +excerpt: Creates an animated underline effect when the user hovers over the text. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/image-hover-menu.md b/content/snippets/css/s/image-hover-menu.md index 344f6e058b3..54bfb75e7da 100644 --- a/content/snippets/css/s/image-hover-menu.md +++ b/content/snippets/css/s/image-hover-menu.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout,animation] cover: compass +excerpt: Displays a menu overlay when the user hovers over the image. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/image-hover-rotate.md b/content/snippets/css/s/image-hover-rotate.md index eff0107f508..276e02f5167 100644 --- a/content/snippets/css/s/image-hover-rotate.md +++ b/content/snippets/css/s/image-hover-rotate.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation,visual] cover: succulent-1 +excerpt: Creates a rotate effect for the image on hover. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/image-mosaic.md b/content/snippets/css/s/image-mosaic.md index 27cc1dd5e56..64ba6d8efd7 100644 --- a/content/snippets/css/s/image-mosaic.md +++ b/content/snippets/css/s/image-mosaic.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: beach-riders +excerpt: Creates a responsive image mosaic. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/image-overlay-hover.md b/content/snippets/css/s/image-overlay-hover.md index 1786248a8ad..5b3fcc2caff 100644 --- a/content/snippets/css/s/image-overlay-hover.md +++ b/content/snippets/css/s/image-overlay-hover.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,animation] cover: architectural +excerpt: Displays an image overlay effect on hover. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/image-text-overlay.md b/content/snippets/css/s/image-text-overlay.md index 77a46c294df..9642323e5b3 100644 --- a/content/snippets/css/s/image-text-overlay.md +++ b/content/snippets/css/s/image-text-overlay.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: icebreaker +excerpt: Displays an image with a text overlay. +listed: true dateModified: 2023-01-29 --- diff --git a/content/snippets/css/s/inherited-properties-cheatsheet.md b/content/snippets/css/s/inherited-properties-cheatsheet.md index 251c3987d0c..7d4d1d2268d 100644 --- a/content/snippets/css/s/inherited-properties-cheatsheet.md +++ b/content/snippets/css/s/inherited-properties-cheatsheet.md @@ -6,6 +6,7 @@ language: css tags: [layout,cheatsheet] cover: half-trees excerpt: A quick reference for inherited CSS properties. +listed: true dateModified: 2022-11-20 --- diff --git a/content/snippets/css/s/input-with-prefix.md b/content/snippets/css/s/input-with-prefix.md index a21704f19de..f3a9074bf09 100644 --- a/content/snippets/css/s/input-with-prefix.md +++ b/content/snippets/css/s/input-with-prefix.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity,visual] cover: flower-portrait-4 +excerpt: Creates an input with a visual, non-editable prefix. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/isometric-card.md b/content/snippets/css/s/isometric-card.md index b1101d5b2e3..4dc9cbf63f6 100644 --- a/content/snippets/css/s/isometric-card.md +++ b/content/snippets/css/s/isometric-card.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: guitar-living-room +excerpt: Creates an isometric card. +listed: true dateModified: 2021-05-17 --- diff --git a/content/snippets/css/s/line-clamp.md b/content/snippets/css/s/line-clamp.md index 298bbdc54c5..2235f6177e8 100644 --- a/content/snippets/css/s/line-clamp.md +++ b/content/snippets/css/s/line-clamp.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout,visual] cover: typewriter +excerpt: Limit multiline text to a given number of lines. +listed: true dateModified: 2021-05-16 --- diff --git a/content/snippets/css/s/masonry-layout.md b/content/snippets/css/s/masonry-layout.md index f4440bd8104..dcd36f00169 100644 --- a/content/snippets/css/s/masonry-layout.md +++ b/content/snippets/css/s/masonry-layout.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: interior-2 +excerpt: Creates a masonry-style layout that is especially useful when working with images. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/mouse-cursor-gradient-tracking.md b/content/snippets/css/s/mouse-cursor-gradient-tracking.md index f351bb2d1a9..381291becb8 100644 --- a/content/snippets/css/s/mouse-cursor-gradient-tracking.md +++ b/content/snippets/css/s/mouse-cursor-gradient-tracking.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,interactivity] cover: tram-car +excerpt: A hover effect where the gradient follows the mouse cursor. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/css/s/navigation-list-item-hover-and-focus-effect.md b/content/snippets/css/s/navigation-list-item-hover-and-focus-effect.md index a9576c622ad..5f185c56651 100644 --- a/content/snippets/css/s/navigation-list-item-hover-and-focus-effect.md +++ b/content/snippets/css/s/navigation-list-item-hover-and-focus-effect.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: cloudy-rock-formation +excerpt: Creates a custom hover and focus effect for navigation items, using CSS transformations. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/nested-border-radius.md b/content/snippets/css/s/nested-border-radius.md index bc4123088e2..7c299c0ee37 100644 --- a/content/snippets/css/s/nested-border-radius.md +++ b/content/snippets/css/s/nested-border-radius.md @@ -5,6 +5,7 @@ language: css tags: [visual] cover: rocky-beach-waves excerpt: Nesting elements with rounded borders can look very wrong if not done correctly. Here's a quick tip on how to do it right. +listed: true dateModified: 2022-04-03 --- diff --git a/content/snippets/css/s/offscreen.md b/content/snippets/css/s/offscreen.md index e0212fa8de5..0de8e3b7448 100644 --- a/content/snippets/css/s/offscreen.md +++ b/content/snippets/css/s/offscreen.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout,visual] cover: succulent-2 +excerpt: Hides an element completely (visually and positionally) in the DOM while still allowing it to be accessible. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/overflow-scroll-gradient.md b/content/snippets/css/s/overflow-scroll-gradient.md index 5600e8ffeda..e80571364a4 100644 --- a/content/snippets/css/s/overflow-scroll-gradient.md +++ b/content/snippets/css/s/overflow-scroll-gradient.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: memories-of-pineapple-1 +excerpt: Adds a fading gradient to an overflowing element to better indicate there is more content to be scrolled. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/perfect-transition-duration.md b/content/snippets/css/s/perfect-transition-duration.md index fd563940700..017e0144e78 100644 --- a/content/snippets/css/s/perfect-transition-duration.md +++ b/content/snippets/css/s/perfect-transition-duration.md @@ -6,6 +6,7 @@ language: css tags: [interactivity,visual,animation] cover: perfect-timing excerpt: Learn how to make your CSS transitions feel perfect when users interact with elements on the page with this simple tip. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/css/s/popout-menu.md b/content/snippets/css/s/popout-menu.md index 31e0c4a4395..0a148dd648f 100644 --- a/content/snippets/css/s/popout-menu.md +++ b/content/snippets/css/s/popout-menu.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: city-view +excerpt: Reveals an interactive popout menu on hover/focus. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/pretty-text-underline.md b/content/snippets/css/s/pretty-text-underline.md index d5bdec5f1ad..c0c74ca99fd 100644 --- a/content/snippets/css/s/pretty-text-underline.md +++ b/content/snippets/css/s/pretty-text-underline.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: flower-portrait-6 +excerpt: "Provides a nicer alternative to `text-decoration: underline` where descenders do not clip the underline." +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/print-stylesheet.md b/content/snippets/css/s/print-stylesheet.md index 831338a44fd..64792c1a79f 100644 --- a/content/snippets/css/s/print-stylesheet.md +++ b/content/snippets/css/s/print-stylesheet.md @@ -5,6 +5,7 @@ language: css tags: [visual] cover: cozy-desk-setup excerpt: A short opinionated print stylesheet to make your websites look great on paper. +listed: true dateModified: 2023-06-11 --- diff --git a/content/snippets/css/s/pseudo-classes.md b/content/snippets/css/s/pseudo-classes.md index a9a890e2418..2902875525f 100644 --- a/content/snippets/css/s/pseudo-classes.md +++ b/content/snippets/css/s/pseudo-classes.md @@ -6,6 +6,7 @@ language: css tags: [webdev] cover: orange-flower excerpt: Learn how to use CSS pseudo-classes to style an element based on changes to its state. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/css/s/pulse-loader.md b/content/snippets/css/s/pulse-loader.md index f42a0930a40..7cb886da51d 100644 --- a/content/snippets/css/s/pulse-loader.md +++ b/content/snippets/css/s/pulse-loader.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: digital-nomad-8 +excerpt: Creates a pulse effect loader animation using the `animation-delay` property. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/reset-all-styles.md b/content/snippets/css/s/reset-all-styles.md index deabd46b381..cc8dc158e77 100644 --- a/content/snippets/css/s/reset-all-styles.md +++ b/content/snippets/css/s/reset-all-styles.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: rocky-beach-2 +excerpt: Resets all styles to default values using only one property. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/reset.md b/content/snippets/css/s/reset.md index e89cb019fba..2c63df83ece 100644 --- a/content/snippets/css/s/reset.md +++ b/content/snippets/css/s/reset.md @@ -5,6 +5,7 @@ language: css tags: [visual] cover: bridge-over-road excerpt: A short, opinionated CSS reset to make your websites look great everywhere. +listed: true dateModified: 2022-10-16 --- diff --git a/content/snippets/css/s/responsive-favicon-dark-mode.md b/content/snippets/css/s/responsive-favicon-dark-mode.md index 4bdf2e430c6..3454f404a24 100644 --- a/content/snippets/css/s/responsive-favicon-dark-mode.md +++ b/content/snippets/css/s/responsive-favicon-dark-mode.md @@ -6,6 +6,7 @@ language: css tags: [visual] cover: dark-mode excerpt: Learn how to create a custom responsive favicon that can adapt its color palette for dark mode with this quick guide. +listed: true dateModified: 2021-09-28 --- diff --git a/content/snippets/css/s/responsive-layout-sidebar.md b/content/snippets/css/s/responsive-layout-sidebar.md index baaefde9179..212d12543e6 100644 --- a/content/snippets/css/s/responsive-layout-sidebar.md +++ b/content/snippets/css/s/responsive-layout-sidebar.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: red-petals +excerpt: Creates a responsive layout with a content area and a sidebar. +listed: true dateModified: 2020-09-16 --- diff --git a/content/snippets/css/s/root-vs-html.md b/content/snippets/css/s/root-vs-html.md index 1c86efcb0de..7b938be50a0 100644 --- a/content/snippets/css/s/root-vs-html.md +++ b/content/snippets/css/s/root-vs-html.md @@ -6,6 +6,7 @@ language: css tags: [layout,selector] cover: tree-roots excerpt: The CSS selectors used to target the root element of an HTML share some similarities, but they also have some differences. +listed: true dateModified: 2022-05-22 --- diff --git a/content/snippets/css/s/rotating-card.md b/content/snippets/css/s/rotating-card.md index 5b9de97e4b9..7af1347c46a 100644 --- a/content/snippets/css/s/rotating-card.md +++ b/content/snippets/css/s/rotating-card.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: digital-nomad-11 +excerpt: Creates a two sided card which rotates on hover. +listed: true dateModified: 2021-03-30 --- diff --git a/content/snippets/css/s/scroll-progress-bar.md b/content/snippets/css/s/scroll-progress-bar.md index be7ce6a2ed6..9dbf39dda0a 100644 --- a/content/snippets/css/s/scroll-progress-bar.md +++ b/content/snippets/css/s/scroll-progress-bar.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation,visual] cover: coworking-space +excerpt: Creates a progress bar indicating the scroll percentage of the page. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/select-any-link.md b/content/snippets/css/s/select-any-link.md index 9113be5f563..a293d2f12b5 100644 --- a/content/snippets/css/s/select-any-link.md +++ b/content/snippets/css/s/select-any-link.md @@ -6,6 +6,7 @@ language: css tags: [visual,interactivity] cover: round-leaves excerpt: You can use a CSS pseudo-class selector to style all links in a page, without worrying if they have been visited or not. +listed: true dateModified: 2022-03-06 --- diff --git a/content/snippets/css/s/shake-invalid-input.md b/content/snippets/css/s/shake-invalid-input.md index 8ed7a0d0b45..edef3ad9341 100644 --- a/content/snippets/css/s/shake-invalid-input.md +++ b/content/snippets/css/s/shake-invalid-input.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: perfect-timing +excerpt: Creates a shake animation on invalid input. +listed: true dateModified: 2022-07-31 --- diff --git a/content/snippets/css/s/shape-separator.md b/content/snippets/css/s/shape-separator.md index b955b1e5e9c..18f5cccbd93 100644 --- a/content/snippets/css/s/shape-separator.md +++ b/content/snippets/css/s/shape-separator.md @@ -3,8 +3,9 @@ title: Shape separator type: snippet language: css tags: [visual] -unlisted: true cover: shapes +excerpt: Uses an SVG shape to create a separator between two different blocks. +listed: false dateModified: 2021-01-04 --- diff --git a/content/snippets/css/s/shapes.md b/content/snippets/css/s/shapes.md index bfbecd3fd34..4003b227bca 100644 --- a/content/snippets/css/s/shapes.md +++ b/content/snippets/css/s/shapes.md @@ -6,6 +6,7 @@ language: css tags: [visual,cheatsheet] cover: oven-paddle excerpt: Use CSS to create various shapes like circles, triangles, and squares. +listed: true dateModified: 2024-05-08 --- diff --git a/content/snippets/css/s/shifting-card.md b/content/snippets/css/s/shifting-card.md index 62524ed9796..ffc5c4bea5e 100644 --- a/content/snippets/css/s/shifting-card.md +++ b/content/snippets/css/s/shifting-card.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: clouds-n-mountains +excerpt: Creates a card that shifts on hover. +listed: true dateModified: 2022-12-14 --- diff --git a/content/snippets/css/s/sibling-fade.md b/content/snippets/css/s/sibling-fade.md index 5062edcd92c..ea296668cb5 100644 --- a/content/snippets/css/s/sibling-fade.md +++ b/content/snippets/css/s/sibling-fade.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: messy-papers +excerpt: Fades out the siblings of a hovered item. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/squiggle-link-hover-effect.md b/content/snippets/css/s/squiggle-link-hover-effect.md index d2e9fe5d5e1..d48808b4ed1 100644 --- a/content/snippets/css/s/squiggle-link-hover-effect.md +++ b/content/snippets/css/s/squiggle-link-hover-effect.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation,visual] cover: dreamy-flowers +excerpt: Creates a squiggle effect when hovering over a link. +listed: true dateModified: 2023-01-10 --- diff --git a/content/snippets/css/s/staggered-animation.md b/content/snippets/css/s/staggered-animation.md index 4ac662534dc..2278d2eeb96 100644 --- a/content/snippets/css/s/staggered-animation.md +++ b/content/snippets/css/s/staggered-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: aerial-view-port +excerpt: Creates a staggered animation for the elements of a list. +listed: true dateModified: 2021-10-11 --- diff --git a/content/snippets/css/s/sticky-list-titles.md b/content/snippets/css/s/sticky-list-titles.md index abde58492ba..29b1074164a 100644 --- a/content/snippets/css/s/sticky-list-titles.md +++ b/content/snippets/css/s/sticky-list-titles.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: interior-7 +excerpt: Creates a list with sticky headings for each section. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/style-default-links.md b/content/snippets/css/s/style-default-links.md index b025c5c1fe1..1b23dbf4e1b 100644 --- a/content/snippets/css/s/style-default-links.md +++ b/content/snippets/css/s/style-default-links.md @@ -6,6 +6,7 @@ language: css tags: [visual,interactivity] cover: citrus-drink excerpt: A short summary of your story up to 180 characters long. +listed: true dateModified: 2022-11-23 --- diff --git a/content/snippets/css/s/stylized-quotation-marks.md b/content/snippets/css/s/stylized-quotation-marks.md index fdee2543971..ecbe04948c7 100644 --- a/content/snippets/css/s/stylized-quotation-marks.md +++ b/content/snippets/css/s/stylized-quotation-marks.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: coffee-phone-tray +excerpt: Customizes the style of inline quotation marks. +listed: true dateModified: 2021-05-16 --- diff --git a/content/snippets/css/s/system-font-stack.md b/content/snippets/css/s/system-font-stack.md index c6b40ca061a..25136e5fc05 100644 --- a/content/snippets/css/s/system-font-stack.md +++ b/content/snippets/css/s/system-font-stack.md @@ -6,6 +6,7 @@ language: css tags: [visual] cover: lavender-shelf excerpt: Learn how to leverage the native fonts of the operating system to get close to a native app feel. +listed: true dateModified: 2024-03-01 --- diff --git a/content/snippets/css/s/text-backdrop-overlay.md b/content/snippets/css/s/text-backdrop-overlay.md index f87743f72bb..9d48329e5aa 100644 --- a/content/snippets/css/s/text-backdrop-overlay.md +++ b/content/snippets/css/s/text-backdrop-overlay.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: mountain-lake-cottage +excerpt: Displays a text on top of an image using an overlay. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/s/tile-layout-using-inline-block.md b/content/snippets/css/s/tile-layout-using-inline-block.md index 6eef289ee1b..f81e503e763 100644 --- a/content/snippets/css/s/tile-layout-using-inline-block.md +++ b/content/snippets/css/s/tile-layout-using-inline-block.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: godray-computer-mug +excerpt: "Aligns items horizontally using `display: inline-block` to create a 3-tile layout." +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/toggle-switch.md b/content/snippets/css/s/toggle-switch.md index 68f65faf82f..5847d2059d7 100644 --- a/content/snippets/css/s/toggle-switch.md +++ b/content/snippets/css/s/toggle-switch.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,interactivity] cover: interior-5 +excerpt: Creates a toggle switch with CSS only. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/truncate-text-multiline.md b/content/snippets/css/s/truncate-text-multiline.md index bb01f203587..b97ff3e525e 100644 --- a/content/snippets/css/s/truncate-text-multiline.md +++ b/content/snippets/css/s/truncate-text-multiline.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: blue-computer +excerpt: Truncates text that is longer than one line. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/css/s/truncate-text.md b/content/snippets/css/s/truncate-text.md index d63d944071c..1bfd329f981 100644 --- a/content/snippets/css/s/truncate-text.md +++ b/content/snippets/css/s/truncate-text.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [layout] cover: houses-rock-sea +excerpt: Truncates text that is longer than one line, adding an ellipsis at the end (`…`). +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/typewriter-effect.md b/content/snippets/css/s/typewriter-effect.md index ba6a7f92c54..50ccee79f97 100644 --- a/content/snippets/css/s/typewriter-effect.md +++ b/content/snippets/css/s/typewriter-effect.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: italian-horizon +excerpt: Creates a typewriter effect animation. +listed: true dateModified: 2021-05-24 --- diff --git a/content/snippets/css/s/typographic-scale-basics.md b/content/snippets/css/s/typographic-scale-basics.md index ce3808342aa..1c955328bf9 100644 --- a/content/snippets/css/s/typographic-scale-basics.md +++ b/content/snippets/css/s/typographic-scale-basics.md @@ -5,6 +5,7 @@ language: css tags: [webdev,typography] cover: typography excerpt: Typography might seem intimidating, but you can quickly and easily create a simple typographic scale with this basic technique. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/css/s/unitless-line-height.md b/content/snippets/css/s/unitless-line-height.md index 3276cd01f52..e5ec161a49a 100644 --- a/content/snippets/css/s/unitless-line-height.md +++ b/content/snippets/css/s/unitless-line-height.md @@ -6,6 +6,7 @@ language: css tags: [layout,visual] cover: gold-typewriter excerpt: You might have heard that `line-height` should be unitless, but do you know why? +listed: true dateModified: 2022-11-27 --- diff --git a/content/snippets/css/s/units-cheatsheet.md b/content/snippets/css/s/units-cheatsheet.md index e2aa95c205c..c4a2ce760a8 100644 --- a/content/snippets/css/s/units-cheatsheet.md +++ b/content/snippets/css/s/units-cheatsheet.md @@ -5,6 +5,7 @@ language: css tags: [layout,cheatsheet] cover: measuring excerpt: Learn everything you need to know about CSS units with this handy cheatsheet. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/css/s/variables.md b/content/snippets/css/s/variables.md index 4c495ce97e7..68dfa224ad1 100644 --- a/content/snippets/css/s/variables.md +++ b/content/snippets/css/s/variables.md @@ -6,6 +6,7 @@ language: css tags: [visual,layout] cover: css-variables excerpt: Learn how CSS custom properties (CSS variables) work and what you can use them for in your code and designs. +listed: true dateModified: 2021-09-28 --- diff --git a/content/snippets/css/s/vertical-gallery.md b/content/snippets/css/s/vertical-gallery.md index 870dbc478c8..ab4ebf3d6f6 100644 --- a/content/snippets/css/s/vertical-gallery.md +++ b/content/snippets/css/s/vertical-gallery.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual,interactivity] cover: lake-loop +excerpt: Creates a horizontally scrollable image gallery. +listed: true dateModified: 2022-05-05 --- diff --git a/content/snippets/css/s/vertical-scroll-snap.md b/content/snippets/css/s/vertical-scroll-snap.md index b3fa57fd7ed..c9ed0a9fd9d 100644 --- a/content/snippets/css/s/vertical-scroll-snap.md +++ b/content/snippets/css/s/vertical-scroll-snap.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [interactivity] cover: purple-sunset-waves +excerpt: Creates a scrollable container that will snap on elements when scrolling. +listed: true dateModified: 2020-08-18 --- diff --git a/content/snippets/css/s/zebra-striped-list.md b/content/snippets/css/s/zebra-striped-list.md index b9867d6dd2b..6720f6ac44e 100644 --- a/content/snippets/css/s/zebra-striped-list.md +++ b/content/snippets/css/s/zebra-striped-list.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [visual] cover: forest-balcony +excerpt: Creates a striped list with alternating background colors. +listed: true dateModified: 2020-12-30 --- diff --git a/content/snippets/css/s/zoomin-zoomout-animation.md b/content/snippets/css/s/zoomin-zoomout-animation.md index 98a04d932f8..b6c15a19bb1 100644 --- a/content/snippets/css/s/zoomin-zoomout-animation.md +++ b/content/snippets/css/s/zoomin-zoomout-animation.md @@ -4,6 +4,8 @@ type: snippet language: css tags: [animation] cover: travel-mug-2 +excerpt: Creates a zoom in zoom out animation. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/css/snippet-template.md b/content/snippets/css/snippet-template.md index c8fee87b2af..24686a59b29 100644 --- a/content/snippets/css/snippet-template.md +++ b/content/snippets/css/snippet-template.md @@ -6,6 +6,7 @@ language: css tags: [layout] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/demo/s/test-snippet.md b/content/snippets/demo/s/test-snippet.md index aa0c28a2d79..783467b086d 100644 --- a/content/snippets/demo/s/test-snippet.md +++ b/content/snippets/demo/s/test-snippet.md @@ -4,8 +4,8 @@ type: story language: javascript tags: [link] cover: do-more-computer -unlisted: true excerpt: This is a test snippet, do not publish it! +listed: false dateModified: 2100-12-31 --- diff --git a/content/snippets/git/s/5-tips-for-better-pull-requests.md b/content/snippets/git/s/5-tips-for-better-pull-requests.md index fcc208dfa52..1490fb4a149 100644 --- a/content/snippets/git/s/5-tips-for-better-pull-requests.md +++ b/content/snippets/git/s/5-tips-for-better-pull-requests.md @@ -5,7 +5,7 @@ language: git tags: [github,programming,webdev] cover: keyboard-tea excerpt: Writing good code is only part of the job. Here are 5 tips to improve your pull requests and help people review them. -unlisted: true +listed: false dateModified: 2021-06-12 --- diff --git a/content/snippets/git/s/aliases.md b/content/snippets/git/s/aliases.md index b2e4eb00475..2de0707c100 100644 --- a/content/snippets/git/s/aliases.md +++ b/content/snippets/git/s/aliases.md @@ -6,6 +6,7 @@ language: git tags: [configuration,cheatsheet] cover: compass-1 excerpt: Increase your productivity and reduce your cognitive load by creating aliases for many common git operations. +listed: true dateModified: 2024-05-03 --- diff --git a/content/snippets/git/s/autocorrect.md b/content/snippets/git/s/autocorrect.md index 4bd93dbce26..210b6946134 100644 --- a/content/snippets/git/s/autocorrect.md +++ b/content/snippets/git/s/autocorrect.md @@ -6,6 +6,7 @@ language: git tags: [configuration] cover: purple-flower-bunch excerpt: Mistyping commands often? Enable Git's autocorrect feature to automatically fix them. +listed: true dateModified: 2024-03-28 --- diff --git a/content/snippets/git/s/automatic-push-upstream.md b/content/snippets/git/s/automatic-push-upstream.md index d48f2eef3f3..77bcd759132 100644 --- a/content/snippets/git/s/automatic-push-upstream.md +++ b/content/snippets/git/s/automatic-push-upstream.md @@ -6,6 +6,7 @@ language: git tags: [configuration,repository] cover: messy-computer excerpt: Effortlessly create upstream branches on push by enabling a simple Git config setting. +listed: true dateModified: 2023-05-21 --- diff --git a/content/snippets/git/s/branches-containing-commit.md b/content/snippets/git/s/branches-containing-commit.md index 3f1083eb39e..7083326619e 100644 --- a/content/snippets/git/s/branches-containing-commit.md +++ b/content/snippets/git/s/branches-containing-commit.md @@ -6,6 +6,7 @@ language: git tags: [branch,commit] cover: dark-leaves excerpt: Learn how to filter branches based on whether they contain a specific commit or not. +listed: true dateModified: 2023-05-25 --- diff --git a/content/snippets/git/s/clone-repo.md b/content/snippets/git/s/clone-repo.md index 2d7c29ed38a..fbf7b9e7fc7 100644 --- a/content/snippets/git/s/clone-repo.md +++ b/content/snippets/git/s/clone-repo.md @@ -6,6 +6,7 @@ language: git tags: [repository,remote] cover: fruit-feast excerpt: The first step to working with a Git repository is often to clone it to your local machine. +listed: true dateModified: 2024-04-24 --- diff --git a/content/snippets/git/s/commit-different-date.md b/content/snippets/git/s/commit-different-date.md index ac4fdf29b0c..0e6fe3f8951 100644 --- a/content/snippets/git/s/commit-different-date.md +++ b/content/snippets/git/s/commit-different-date.md @@ -5,6 +5,7 @@ language: git tags: [commit] cover: ice excerpt: Ever needed to create a git commit with a different date? Here's a quick and easy way to do it. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/git/s/commit-template.md b/content/snippets/git/s/commit-template.md index c86a1e132cf..5dcb4420337 100644 --- a/content/snippets/git/s/commit-template.md +++ b/content/snippets/git/s/commit-template.md @@ -6,6 +6,7 @@ language: git tags: [repository,configuration] cover: river-house-lights excerpt: If you want your team to follow a common format for commit messages, you can set up a commit message template to make it easier. +listed: true dateModified: 2024-04-10 --- diff --git a/content/snippets/git/s/config-user.md b/content/snippets/git/s/config-user.md index 6aba8b1b4d0..2c4d8971cd4 100644 --- a/content/snippets/git/s/config-user.md +++ b/content/snippets/git/s/config-user.md @@ -6,6 +6,7 @@ language: git tags: [configuration,repository] cover: pineapple-at-work excerpt: Configure user information for Git to associate commits with a user. +listed: true dateModified: 2024-04-04 --- diff --git a/content/snippets/git/s/configure-default-text-editor.md b/content/snippets/git/s/configure-default-text-editor.md index bda22eb325c..cbf130fcd94 100644 --- a/content/snippets/git/s/configure-default-text-editor.md +++ b/content/snippets/git/s/configure-default-text-editor.md @@ -6,6 +6,7 @@ language: git tags: [configuration] cover: purple-sunset-beach excerpt: Learn how to configure the text editor used by Git for commit messages and other text editing tasks. +listed: true dateModified: 2024-04-09 --- diff --git a/content/snippets/git/s/copy-file-from-branch.md b/content/snippets/git/s/copy-file-from-branch.md index 2b5f026cddd..24ba5aa3a3e 100644 --- a/content/snippets/git/s/copy-file-from-branch.md +++ b/content/snippets/git/s/copy-file-from-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: sea-view-2 excerpt: If you need to copy a file from another branch to the current branch, here's an easy way to do it. +listed: true dateModified: 2024-04-16 --- diff --git a/content/snippets/git/s/create-branch.md b/content/snippets/git/s/create-branch.md index 21a13c5bc52..87f430e6f21 100644 --- a/content/snippets/git/s/create-branch.md +++ b/content/snippets/git/s/create-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch,remote] cover: flower-pond excerpt: Learn how to create a new Git branch and optionally set up a remote tracking branch. +listed: true dateModified: 2024-04-28 --- diff --git a/content/snippets/git/s/create-commit.md b/content/snippets/git/s/create-commit.md index 52d748b1a73..a0d83082206 100644 --- a/content/snippets/git/s/create-commit.md +++ b/content/snippets/git/s/create-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: cave-explorer excerpt: Learn how to create a new commit in Git, along with tricks to skip Git hooks and create empty commits. +listed: true dateModified: 2024-04-20 --- diff --git a/content/snippets/git/s/create-fixup-commit.md b/content/snippets/git/s/create-fixup-commit.md index 90ee28fad56..dca6aa59e64 100644 --- a/content/snippets/git/s/create-fixup-commit.md +++ b/content/snippets/git/s/create-fixup-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: tools excerpt: If you find yourself needing to fix a previous commit, you can create a fixup commit that can be autosquashed in the next rebase. +listed: true dateModified: 2024-05-02 --- diff --git a/content/snippets/git/s/create-repo.md b/content/snippets/git/s/create-repo.md index 9336b8f3095..dd6d6ccf0b5 100644 --- a/content/snippets/git/s/create-repo.md +++ b/content/snippets/git/s/create-repo.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: do-more-computer excerpt: The first step is often the hardest, yet creating a Git repository is as simple as running a single command. +listed: true dateModified: 2024-04-14 --- diff --git a/content/snippets/git/s/current-branch-name.md b/content/snippets/git/s/current-branch-name.md index 2e167d5d6a0..748d382e0cc 100644 --- a/content/snippets/git/s/current-branch-name.md +++ b/content/snippets/git/s/current-branch-name.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: cherry-trees excerpt: Get the name of the current branch in Git. +listed: true dateModified: 2024-04-22 --- diff --git a/content/snippets/git/s/delete-branch.md b/content/snippets/git/s/delete-branch.md index 29f50b8c4b5..fda3e0927ef 100644 --- a/content/snippets/git/s/delete-branch.md +++ b/content/snippets/git/s/delete-branch.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: volcano-sunset excerpt: Having trouble deleting branches in Git? Here's a guide to help you delete local, remote, detached, and merged branches. +listed: true dateModified: 2024-04-06 --- diff --git a/content/snippets/git/s/difference-between-branches.md b/content/snippets/git/s/difference-between-branches.md index 29c8c12cf51..10e5835d559 100644 --- a/content/snippets/git/s/difference-between-branches.md +++ b/content/snippets/git/s/difference-between-branches.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: two-doors excerpt: Want to compare the changes between two branches in Git? Here's how you can do it. +listed: true dateModified: 2024-04-23 --- diff --git a/content/snippets/git/s/disable-fast-forward.md b/content/snippets/git/s/disable-fast-forward.md index d8f91a78607..08c7ec4f545 100644 --- a/content/snippets/git/s/disable-fast-forward.md +++ b/content/snippets/git/s/disable-fast-forward.md @@ -6,6 +6,7 @@ language: git tags: [configuration,repository] cover: people-on-beach excerpt: Git defaults to fast-forward merging when possible. But, what if you want to disable it by default? Let's see how you can do that. +listed: true dateModified: 2024-04-15 --- diff --git a/content/snippets/git/s/discard-changes.md b/content/snippets/git/s/discard-changes.md index a46ad32c126..9a10c382d26 100644 --- a/content/snippets/git/s/discard-changes.md +++ b/content/snippets/git/s/discard-changes.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: cold-mountains excerpt: Made some changes you don't want to keep? Learn how to discard uncommitted or untracked changes in Git. +listed: true dateModified: 2024-04-12 --- diff --git a/content/snippets/git/s/edit-config.md b/content/snippets/git/s/edit-config.md index 0768866005f..f9cfaacbd4b 100644 --- a/content/snippets/git/s/edit-config.md +++ b/content/snippets/git/s/edit-config.md @@ -6,6 +6,7 @@ language: git tags: [configuration] cover: terminal excerpt: Learn how to open the Git configuration file in the Git text editor, for editing. +listed: true dateModified: 2024-04-11 --- diff --git a/content/snippets/git/s/fast-forward-merge.md b/content/snippets/git/s/fast-forward-merge.md index 8c759ac4f8f..b95e4b24f7a 100644 --- a/content/snippets/git/s/fast-forward-merge.md +++ b/content/snippets/git/s/fast-forward-merge.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: boats excerpt: Learn about Git's fast-forward mode and its benefits when merging branches, so you can decide if it's a good fit for you and your team. +listed: true dateModified: 2021-07-15 --- diff --git a/content/snippets/git/s/fetch-changes.md b/content/snippets/git/s/fetch-changes.md index 33c7542211c..cbf035eb34e 100644 --- a/content/snippets/git/s/fetch-changes.md +++ b/content/snippets/git/s/fetch-changes.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: playing-fetch excerpt: Learn how to fetch the latest changes from the remote repository in Git and keep your local repository up to date. +listed: true dateModified: 2024-04-19 --- diff --git a/content/snippets/git/s/find-commit-with-bug.md b/content/snippets/git/s/find-commit-with-bug.md index 957fc385d3e..a458a9adbdc 100644 --- a/content/snippets/git/s/find-commit-with-bug.md +++ b/content/snippets/git/s/find-commit-with-bug.md @@ -6,6 +6,7 @@ language: git tags: [commit,branch] cover: pink-flower-tree excerpt: Manually or automatically find which commit in history introduced a bug using. +listed: true dateModified: 2024-03-27 --- diff --git a/content/snippets/git/s/find-lost-files.md b/content/snippets/git/s/find-lost-files.md index 6b14e1827db..096320e637b 100644 --- a/content/snippets/git/s/find-lost-files.md +++ b/content/snippets/git/s/find-lost-files.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: hard-disk excerpt: Learn how to find lost files and commits in a Git repository. +listed: true dateModified: 2024-05-01 --- diff --git a/content/snippets/git/s/find-matching-files.md b/content/snippets/git/s/find-matching-files.md index 51abd2c5944..e1aaac1b188 100644 --- a/content/snippets/git/s/find-matching-files.md +++ b/content/snippets/git/s/find-matching-files.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch,commit] cover: boulder-beach excerpt: Learn how to leverage the power of `git grep` to find matching files in your repository. +listed: true dateModified: 2024-05-06 --- diff --git a/content/snippets/git/s/find-merge-commit.md b/content/snippets/git/s/find-merge-commit.md index c6c0ec4e0f4..6865eeee9f2 100644 --- a/content/snippets/git/s/find-merge-commit.md +++ b/content/snippets/git/s/find-merge-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: travel-mug-1 excerpt: Looking for the merge commit where the changes from a given commit were merged into a branch? Here's how you can find it. +listed: true dateModified: 2024-05-04 --- diff --git a/content/snippets/git/s/force-update-remote-branch.md b/content/snippets/git/s/force-update-remote-branch.md index fab4ce0988a..126cbcab936 100644 --- a/content/snippets/git/s/force-update-remote-branch.md +++ b/content/snippets/git/s/force-update-remote-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: compass excerpt: Learn how to force update a remote branch after rewriting the Git history locally. +listed: true dateModified: 2024-04-15 --- diff --git a/content/snippets/git/s/github-co-authors.md b/content/snippets/git/s/github-co-authors.md index de3d72a3f4f..092821b8b6e 100644 --- a/content/snippets/git/s/github-co-authors.md +++ b/content/snippets/git/s/github-co-authors.md @@ -6,6 +6,7 @@ language: git tags: [github,programming,webdev] cover: book-chair excerpt: Learn how to add multiple authors to a git commit with this quick and easy tip. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/git/s/interactive-rebase.md b/content/snippets/git/s/interactive-rebase.md index 1ba2894bbe8..4bab32ab0a7 100644 --- a/content/snippets/git/s/interactive-rebase.md +++ b/content/snippets/git/s/interactive-rebase.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: tea-laptop-table excerpt: Reorder, squash, and edit commits interactively using Git's interactive rebase feature. +listed: true dateModified: 2024-05-02 --- diff --git a/content/snippets/git/s/line-endings.md b/content/snippets/git/s/line-endings.md index 7b45eea0508..27a1a2d1f5c 100644 --- a/content/snippets/git/s/line-endings.md +++ b/content/snippets/git/s/line-endings.md @@ -6,6 +6,7 @@ language: git tags: [repository,configuration] cover: leaves-read excerpt: If you're working with a team using different operating systems, configuring line endings can help maintain consistency. +listed: true dateModified: 2024-04-13 --- diff --git a/content/snippets/git/s/list-aliases.md b/content/snippets/git/s/list-aliases.md index 0843095e8f2..2bff47afe88 100644 --- a/content/snippets/git/s/list-aliases.md +++ b/content/snippets/git/s/list-aliases.md @@ -6,6 +6,7 @@ language: git tags: [configuration] cover: coffee-float excerpt: Did you set up a lot of Git aliases and forgot what they are? List them all with this command. +listed: true dateModified: 2024-03-30 --- diff --git a/content/snippets/git/s/merge-branch-merge-commit.md b/content/snippets/git/s/merge-branch-merge-commit.md index 16b7109159b..2893cd862ca 100644 --- a/content/snippets/git/s/merge-branch-merge-commit.md +++ b/content/snippets/git/s/merge-branch-merge-commit.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: meteora excerpt: Learn how to merge a branch in Git with or without creating a merge commit, depending on your team's workflow. +listed: true dateModified: 2023-05-26 --- diff --git a/content/snippets/git/s/move-commits-to-branch.md b/content/snippets/git/s/move-commits-to-branch.md index 5c9b409ad37..b2b35d0414d 100644 --- a/content/snippets/git/s/move-commits-to-branch.md +++ b/content/snippets/git/s/move-commits-to-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch,repository] cover: red-succulent excerpt: Did you accidentally commit to `master` instead of a feature branch? Here's how you can move those commits to a new branch. +listed: true dateModified: 2024-04-03 --- diff --git a/content/snippets/git/s/optimize-repository.md b/content/snippets/git/s/optimize-repository.md index f35c2f16291..603931eaba9 100644 --- a/content/snippets/git/s/optimize-repository.md +++ b/content/snippets/git/s/optimize-repository.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: automaton excerpt: Is your Git repository getting bloated? Optimize it by garbage collecting loose objects. +listed: true dateModified: 2024-04-13 --- diff --git a/content/snippets/git/s/pick-commits.md b/content/snippets/git/s/pick-commits.md index f1f9533c477..611a87358fe 100644 --- a/content/snippets/git/s/pick-commits.md +++ b/content/snippets/git/s/pick-commits.md @@ -6,6 +6,7 @@ language: git tags: [commit,branch] cover: sunflowers excerpt: Learn how to apply changes introduced by one or more commits to your current branch (cherry-picking). +listed: true dateModified: 2024-04-16 --- diff --git a/content/snippets/git/s/purge-file.md b/content/snippets/git/s/purge-file.md index 6da96809d1a..0e0986cd2de 100644 --- a/content/snippets/git/s/purge-file.md +++ b/content/snippets/git/s/purge-file.md @@ -6,6 +6,7 @@ language: git tags: [repository,remote] cover: white-flower excerpt: Did you accidentally commit sensitive information? Learn how to completely purge a file from Git history. +listed: true dateModified: 2024-05-01 --- diff --git a/content/snippets/git/s/push-pull-changes.md b/content/snippets/git/s/push-pull-changes.md index 17bfb7b4f93..cf629e52dbc 100644 --- a/content/snippets/git/s/push-pull-changes.md +++ b/content/snippets/git/s/push-pull-changes.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: orange-coffee-2 excerpt: Learn how to push and pull changes between local and remote repositories. +listed: true dateModified: 2023-06-01 --- diff --git a/content/snippets/git/s/rebase-onto-branch.md b/content/snippets/git/s/rebase-onto-branch.md index f79a821377f..d8a41533a6e 100644 --- a/content/snippets/git/s/rebase-onto-branch.md +++ b/content/snippets/git/s/rebase-onto-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: sliced-fruits excerpt: Rebase the current branch onto another branch in Git. +listed: true dateModified: 2024-04-13 --- diff --git a/content/snippets/git/s/remove-file-from-commit.md b/content/snippets/git/s/remove-file-from-commit.md index 51176a1ceed..5a11c7fb7ca 100644 --- a/content/snippets/git/s/remove-file-from-commit.md +++ b/content/snippets/git/s/remove-file-from-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: cancel-typographer excerpt: Have you ever made a commit only to realize that a file should not have been included? Let's see how you can fix this! +listed: true dateModified: 2024-04-02 --- diff --git a/content/snippets/git/s/rename-branch.md b/content/snippets/git/s/rename-branch.md index a00984d5881..44403eba02e 100644 --- a/content/snippets/git/s/rename-branch.md +++ b/content/snippets/git/s/rename-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: horse-sunset excerpt: Made a mistake with your branch name? Learn how to rename a local or remote Git branch. +listed: true dateModified: 2024-04-08 --- diff --git a/content/snippets/git/s/reset-master.md b/content/snippets/git/s/reset-master.md index c9930dbd2e8..664d681bc34 100644 --- a/content/snippets/git/s/reset-master.md +++ b/content/snippets/git/s/reset-master.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: old-consoles excerpt: Learn how to quickly and easily reset your local `master` branch to match the one on the remote. +listed: true dateModified: 2024-03-31 --- diff --git a/content/snippets/git/s/restore-deleted-file.md b/content/snippets/git/s/restore-deleted-file.md index dacf9777e99..aa48be23d96 100644 --- a/content/snippets/git/s/restore-deleted-file.md +++ b/content/snippets/git/s/restore-deleted-file.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: succulent-red-light excerpt: Have you accidentally deleted a file? Or maybe you need to restore a file that was deleted? Here's how Git can help you. +listed: true dateModified: 2024-04-22 --- diff --git a/content/snippets/git/s/rewind-to-commit.md b/content/snippets/git/s/rewind-to-commit.md index 126535e7655..85707f69ab8 100644 --- a/content/snippets/git/s/rewind-to-commit.md +++ b/content/snippets/git/s/rewind-to-commit.md @@ -6,6 +6,7 @@ language: git tags: [branch,commit] cover: walking excerpt: Did you make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git. +listed: true dateModified: 2023-05-26 --- diff --git a/content/snippets/git/s/set-default-push-branch.md b/content/snippets/git/s/set-default-push-branch.md index e75c57f05e2..7e5044afd29 100644 --- a/content/snippets/git/s/set-default-push-branch.md +++ b/content/snippets/git/s/set-default-push-branch.md @@ -6,6 +6,7 @@ language: git tags: [configuration,branch] cover: pink-flower excerpt: Tired of manually specifying the remote branch name when pushing? Configure Git to use the current branch name as the default. +listed: true dateModified: 2024-05-02 --- diff --git a/content/snippets/git/s/set-or-amend-commit-author.md b/content/snippets/git/s/set-or-amend-commit-author.md index 154e5662c23..3926e3bb3b1 100644 --- a/content/snippets/git/s/set-or-amend-commit-author.md +++ b/content/snippets/git/s/set-or-amend-commit-author.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: new-plant excerpt: Ever wanted to commit as someone else? Maybe change the author of an existing commit? Here's how. +listed: true dateModified: 2023-05-24 --- diff --git a/content/snippets/git/s/sort-branches-by-date.md b/content/snippets/git/s/sort-branches-by-date.md index 4470a393aa3..29d0339967f 100644 --- a/content/snippets/git/s/sort-branches-by-date.md +++ b/content/snippets/git/s/sort-branches-by-date.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: sea-view excerpt: Do you want to see a list of all local branches sorted by date? Here's a simple command to help you with that. +listed: true dateModified: 2024-04-01 --- diff --git a/content/snippets/git/s/split-commit.md b/content/snippets/git/s/split-commit.md index 7ea45ad151d..6ea04527ca8 100644 --- a/content/snippets/git/s/split-commit.md +++ b/content/snippets/git/s/split-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit,branch] cover: interior-16 excerpt: Altering Git history to split a commit sounds intimidating, but it's not that hard. Let's walk through the process step by step. +listed: true dateModified: 2024-05-05 --- diff --git a/content/snippets/git/s/stage-unstage-files.md b/content/snippets/git/s/stage-unstage-files.md index c3c6329a4f1..36e49b52fcb 100644 --- a/content/snippets/git/s/stage-unstage-files.md +++ b/content/snippets/git/s/stage-unstage-files.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: coconuts excerpt: Learn how to effectively use Git's staging area, by adding or removing files from it. +listed: true dateModified: 2024-04-07 --- diff --git a/content/snippets/git/s/stashing.md b/content/snippets/git/s/stashing.md index a54197809ca..34c17368d1b 100644 --- a/content/snippets/git/s/stashing.md +++ b/content/snippets/git/s/stashing.md @@ -6,6 +6,7 @@ language: git tags: [repository,stash] cover: purple-leaves excerpt: Learn all you need to know about Git stashing, including how to stash changes, apply, list, and delete stashes. +listed: true dateModified: 2024-04-05 --- diff --git a/content/snippets/git/s/submodules.md b/content/snippets/git/s/submodules.md index 2c669eaf342..5973bfe78fe 100644 --- a/content/snippets/git/s/submodules.md +++ b/content/snippets/git/s/submodules.md @@ -6,6 +6,7 @@ language: git tags: [repository,submodule] cover: rocky-mountains-2 excerpt: Git submodules are a powerful feature that often trips up developers. Fret not, this guide will help you understand the basics. +listed: true dateModified: 2024-04-27 --- diff --git a/content/snippets/git/s/switch-to-branch.md b/content/snippets/git/s/switch-to-branch.md index 46ab006d9ac..d379d07b3bc 100644 --- a/content/snippets/git/s/switch-to-branch.md +++ b/content/snippets/git/s/switch-to-branch.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: bridge excerpt: Learn how to easily switch between branches in Git. +listed: true dateModified: 2024-04-29 --- diff --git a/content/snippets/git/s/undo-commit-without-rewriting-history.md b/content/snippets/git/s/undo-commit-without-rewriting-history.md index 11a4b1c6916..1f80cc68ec2 100644 --- a/content/snippets/git/s/undo-commit-without-rewriting-history.md +++ b/content/snippets/git/s/undo-commit-without-rewriting-history.md @@ -6,6 +6,7 @@ language: git tags: [commit,branch] cover: night-tram excerpt: Learn the simple way to undo a commit in Git without rewriting history. +listed: true dateModified: 2023-05-27 --- diff --git a/content/snippets/git/s/update-commit-message-or-contents.md b/content/snippets/git/s/update-commit-message-or-contents.md index 31810a8b97e..27bf8853264 100644 --- a/content/snippets/git/s/update-commit-message-or-contents.md +++ b/content/snippets/git/s/update-commit-message-or-contents.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: greek-coffee excerpt: Learn how to effortlessly amend the last commit's message or contents using Git and fix any mistakes you might have made. +listed: true dateModified: 2023-05-23 --- diff --git a/content/snippets/git/s/view-all-branches.md b/content/snippets/git/s/view-all-branches.md index b2d4cf458af..233d265948e 100644 --- a/content/snippets/git/s/view-all-branches.md +++ b/content/snippets/git/s/view-all-branches.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: aerial-view-port excerpt: Learn how to view a list of all local or remote branches in a Git repository. +listed: true dateModified: 2024-04-30 --- diff --git a/content/snippets/git/s/view-change-remote-url.md b/content/snippets/git/s/view-change-remote-url.md index 69265e29f24..2a99aaeb073 100644 --- a/content/snippets/git/s/view-change-remote-url.md +++ b/content/snippets/git/s/view-change-remote-url.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: red-mountain excerpt: Learn how to view or change the URL of the remote repository in Git. +listed: true dateModified: 2024-04-18 --- diff --git a/content/snippets/git/s/view-changes-summary.md b/content/snippets/git/s/view-changes-summary.md index 853b5865de6..02cca15097a 100644 --- a/content/snippets/git/s/view-changes-summary.md +++ b/content/snippets/git/s/view-changes-summary.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: taking-photos excerpt: Learn how to view a summary of changes between two Git commits, using a single command. +listed: true dateModified: 2024-04-24 --- diff --git a/content/snippets/git/s/view-commit-graph.md b/content/snippets/git/s/view-commit-graph.md index 5ad8cb8e78c..d685b8af52a 100644 --- a/content/snippets/git/s/view-commit-graph.md +++ b/content/snippets/git/s/view-commit-graph.md @@ -6,6 +6,7 @@ language: git tags: [repository] cover: city-view excerpt: If you're more of a visual person, you can view a graph of all commits and branches in the repository using a single Git command. +listed: true dateModified: 2024-04-25 --- diff --git a/content/snippets/git/s/view-commits-by-author-or-committer.md b/content/snippets/git/s/view-commits-by-author-or-committer.md index f1cb55a3b67..a359fb52c9a 100644 --- a/content/snippets/git/s/view-commits-by-author-or-committer.md +++ b/content/snippets/git/s/view-commits-by-author-or-committer.md @@ -6,6 +6,7 @@ language: git tags: [repository,commit] cover: comic-glasses excerpt: If you're looking for a way to find commits by a specific author or committer in a Git repository, look no further. +listed: true dateModified: 2024-04-25 --- diff --git a/content/snippets/git/s/view-commits-by-string.md b/content/snippets/git/s/view-commits-by-string.md index 8a496cb57a4..5e2ed5931d8 100644 --- a/content/snippets/git/s/view-commits-by-string.md +++ b/content/snippets/git/s/view-commits-by-string.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: bunny-poster excerpt: Learn how to view all commits that manipulated a specific string in a Git repository. +listed: true dateModified: 2024-04-26 --- diff --git a/content/snippets/git/s/view-commits-in-date-range.md b/content/snippets/git/s/view-commits-in-date-range.md index 269d16f6e5e..c59211d8b4a 100644 --- a/content/snippets/git/s/view-commits-in-date-range.md +++ b/content/snippets/git/s/view-commits-in-date-range.md @@ -6,6 +6,7 @@ language: git tags: [repository,commit] cover: organizer excerpt: View all commits in a specific date range using `git log`. +listed: true dateModified: 2024-03-29 --- diff --git a/content/snippets/git/s/view-commits-summary.md b/content/snippets/git/s/view-commits-summary.md index 5f0f79ad74b..a2e929793fc 100644 --- a/content/snippets/git/s/view-commits-summary.md +++ b/content/snippets/git/s/view-commits-summary.md @@ -6,6 +6,7 @@ language: git tags: [repository,commit] cover: dark-city excerpt: Learn how to view a short summary of your Git commits using git log. +listed: true dateModified: 2023-05-23 --- diff --git a/content/snippets/git/s/view-differences.md b/content/snippets/git/s/view-differences.md index 3a62a8c8a5d..c908c60bda1 100644 --- a/content/snippets/git/s/view-differences.md +++ b/content/snippets/git/s/view-differences.md @@ -6,6 +6,7 @@ language: git tags: [commit,branch] cover: plant-candle excerpt: View differences between staged or unstaged changes and the last commit in Git. +listed: true dateModified: 2024-04-21 --- diff --git a/content/snippets/git/s/view-last-commit.md b/content/snippets/git/s/view-last-commit.md index 9ae6fa57067..4709a21c794 100644 --- a/content/snippets/git/s/view-last-commit.md +++ b/content/snippets/git/s/view-last-commit.md @@ -6,6 +6,7 @@ language: git tags: [commit] cover: clouds-n-mountains excerpt: Learn how to view the last commit in Git using the `git log` command. +listed: true dateModified: 2024-04-23 --- diff --git a/content/snippets/git/s/view-merged-branches.md b/content/snippets/git/s/view-merged-branches.md index 7e5db9b0d5d..2e716486cc9 100644 --- a/content/snippets/git/s/view-merged-branches.md +++ b/content/snippets/git/s/view-merged-branches.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: cobbled-street excerpt: Looking for a way to list all merged branches in your Git repository? Look no further. +listed: true dateModified: 2024-04-17 --- diff --git a/content/snippets/git/s/view-status.md b/content/snippets/git/s/view-status.md index 10e53939161..e715fccd240 100644 --- a/content/snippets/git/s/view-status.md +++ b/content/snippets/git/s/view-status.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: periscope excerpt: Learn how to view the current status of the working tree in Git. +listed: true dateModified: 2024-04-12 --- diff --git a/content/snippets/git/s/view-undo-history.md b/content/snippets/git/s/view-undo-history.md index 978931b7d22..d154e576981 100644 --- a/content/snippets/git/s/view-undo-history.md +++ b/content/snippets/git/s/view-undo-history.md @@ -6,6 +6,7 @@ language: git tags: [repository,branch] cover: rock-climbing excerpt: Learn how to view your "undo" history using git reflog and reset your repository to a previous state. +listed: true dateModified: 2023-05-21 --- diff --git a/content/snippets/git/snippet-template.md b/content/snippets/git/snippet-template.md index c7b4a64ffc9..787ff4839f4 100644 --- a/content/snippets/git/snippet-template.md +++ b/content/snippets/git/snippet-template.md @@ -6,6 +6,7 @@ language: git tags: [branch] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/html/s/8-tips-for-accessible-websites.md b/content/snippets/html/s/8-tips-for-accessible-websites.md index 2b815072ac0..cc4f40d53ca 100644 --- a/content/snippets/html/s/8-tips-for-accessible-websites.md +++ b/content/snippets/html/s/8-tips-for-accessible-websites.md @@ -6,6 +6,7 @@ language: html tags: [accessibility,form,link,metadata] cover: accessibility excerpt: Accessibility (a11y) can improve your website and attract new users. Learn how to get started with these 8 quick tips. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/alt-vs-title.md b/content/snippets/html/s/alt-vs-title.md index ecd812a5231..ee5fe33d8c7 100644 --- a/content/snippets/html/s/alt-vs-title.md +++ b/content/snippets/html/s/alt-vs-title.md @@ -6,6 +6,7 @@ language: html tags: [image] cover: stars-n-snow excerpt: Learn the difference between the `alt` and `title` attributes on images in HTML. +listed: true dateModified: 2023-07-02 --- diff --git a/content/snippets/html/s/async-defer.md b/content/snippets/html/s/async-defer.md index ec687f61526..87280eb2bad 100644 --- a/content/snippets/html/s/async-defer.md +++ b/content/snippets/html/s/async-defer.md @@ -6,6 +6,7 @@ language: html tags: [script,javascript] cover: coworking-space excerpt: Understanding how to correctly load your JavaScript files can significantly improve your web application's performance. +listed: true dateModified: 2022-09-04 --- diff --git a/content/snippets/html/s/custom-file-download-names.md b/content/snippets/html/s/custom-file-download-names.md index 46edfdf828c..e2db83bbc3c 100644 --- a/content/snippets/html/s/custom-file-download-names.md +++ b/content/snippets/html/s/custom-file-download-names.md @@ -5,6 +5,7 @@ language: html tags: [link] cover: hard-disk excerpt: Learn what HTML5 attribute you can use to customize the names of your downloadable files with this quick tip. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/data-attributes-as-state.md b/content/snippets/html/s/data-attributes-as-state.md index 6c5a296937b..5b8f49f266c 100644 --- a/content/snippets/html/s/data-attributes-as-state.md +++ b/content/snippets/html/s/data-attributes-as-state.md @@ -6,6 +6,7 @@ language: html tags: [css,javascript] cover: pineapple-on-the-rocks excerpt: Learn how to use data attributes to represent UI state and level up your HTML and CSS game. +listed: true dateModified: 2023-11-13 --- diff --git a/content/snippets/html/s/head-icons.md b/content/snippets/html/s/head-icons.md index 52ad0a27fee..ce2e9c2bd9b 100644 --- a/content/snippets/html/s/head-icons.md +++ b/content/snippets/html/s/head-icons.md @@ -6,6 +6,7 @@ language: html tags: [metadata,head] cover: boutique-home-office-3 excerpt: Ensure your HTML documents have a proper favicon by including these lines in your `` element. +listed: true dateModified: 2023-01-24 --- diff --git a/content/snippets/html/s/head-links.md b/content/snippets/html/s/head-links.md index bef02850e77..67466dbc563 100644 --- a/content/snippets/html/s/head-links.md +++ b/content/snippets/html/s/head-links.md @@ -6,6 +6,7 @@ language: html tags: [metadata,head] cover: boutique-home-office-4 excerpt: Make your HTML documents more SEO-friendly by including these lines in your `` element. +listed: true dateModified: 2023-01-26 --- diff --git a/content/snippets/html/s/head-social-tags.md b/content/snippets/html/s/head-social-tags.md index ff82ef87f80..b7ed60a280f 100644 --- a/content/snippets/html/s/head-social-tags.md +++ b/content/snippets/html/s/head-social-tags.md @@ -6,6 +6,7 @@ language: html tags: [metadata,head] cover: boutique-home-office-2 excerpt: Ensure your HTML documents can be shared on social media by including these lines in your `` element. +listed: true dateModified: 2023-01-22 --- diff --git a/content/snippets/html/s/image-alt.md b/content/snippets/html/s/image-alt.md index 478c2dcc13f..9598ffcaa25 100644 --- a/content/snippets/html/s/image-alt.md +++ b/content/snippets/html/s/image-alt.md @@ -6,6 +6,7 @@ language: html tags: [image,accessibility] cover: sailing-alone excerpt: Learn how to correctly use the `alt` attribute on images in HTML. +listed: true dateModified: 2023-06-25 --- diff --git a/content/snippets/html/s/lazy-loading-images.md b/content/snippets/html/s/lazy-loading-images.md index ad8be6f5cc4..222bb0302eb 100644 --- a/content/snippets/html/s/lazy-loading-images.md +++ b/content/snippets/html/s/lazy-loading-images.md @@ -6,6 +6,7 @@ language: html tags: [image] cover: bridge excerpt: Discover how to improve your website's performance by implementing lazy loading for images using a native HTML attribute. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/number-only-input.md b/content/snippets/html/s/number-only-input.md index 2b1f3772de7..e2e3cfdbf04 100644 --- a/content/snippets/html/s/number-only-input.md +++ b/content/snippets/html/s/number-only-input.md @@ -6,6 +6,7 @@ language: html tags: [form] cover: palm-sun excerpt: Number-only inputs aren't as straightforward as you might expect. Here's a user-friendly way to set them up. +listed: true dateModified: 2024-01-04 --- diff --git a/content/snippets/html/s/open-all-links-in-new-tab.md b/content/snippets/html/s/open-all-links-in-new-tab.md index aeff05114a8..637218feae5 100644 --- a/content/snippets/html/s/open-all-links-in-new-tab.md +++ b/content/snippets/html/s/open-all-links-in-new-tab.md @@ -6,6 +6,7 @@ language: html tags: [link] cover: paper-card excerpt: Using an HTML element, you can easily make all links in your document open in a new tab. Learn how with this quick tip. +listed: true dateModified: 2024-03-16 --- diff --git a/content/snippets/html/s/password-autocomplete-suggestion.md b/content/snippets/html/s/password-autocomplete-suggestion.md index a334a74365e..9ebf86c621f 100644 --- a/content/snippets/html/s/password-autocomplete-suggestion.md +++ b/content/snippets/html/s/password-autocomplete-suggestion.md @@ -6,6 +6,7 @@ language: html tags: [form] cover: padlocks excerpt: Use the HTML `autocomplete` attribute to create more secure and accessible password fields. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/prefetching-resources.md b/content/snippets/html/s/prefetching-resources.md index 902fbed0802..f660ff90e13 100644 --- a/content/snippets/html/s/prefetching-resources.md +++ b/content/snippets/html/s/prefetching-resources.md @@ -6,6 +6,7 @@ language: html tags: [metadata] cover: playing-fetch excerpt: Resource prefetching is a great way to improve perceived page speed on your website and requires little effort. Learn how to use it today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/recommended-minimum-head.md b/content/snippets/html/s/recommended-minimum-head.md index 23bdb4b937e..92cf6dca1a9 100644 --- a/content/snippets/html/s/recommended-minimum-head.md +++ b/content/snippets/html/s/recommended-minimum-head.md @@ -6,6 +6,7 @@ language: html tags: [metadata,head] cover: boutique-home-office-1 excerpt: Ensure your HTML documents are properly structured by including these lines in your `` element. +listed: true dateModified: 2023-01-18 --- diff --git a/content/snippets/html/s/resource-preloading-cheatsheet.md b/content/snippets/html/s/resource-preloading-cheatsheet.md index 42b3817eafb..a59e8b5de88 100644 --- a/content/snippets/html/s/resource-preloading-cheatsheet.md +++ b/content/snippets/html/s/resource-preloading-cheatsheet.md @@ -5,6 +5,7 @@ language: html tags: [metadata,cheatsheet] cover: folded-map excerpt: Preloading content is one of many ways to improve your website's performance. +listed: true dateModified: 2022-10-12 --- diff --git a/content/snippets/html/s/reversed-list.md b/content/snippets/html/s/reversed-list.md index 6cd392858b4..938ab04db3e 100644 --- a/content/snippets/html/s/reversed-list.md +++ b/content/snippets/html/s/reversed-list.md @@ -6,6 +6,7 @@ language: html tags: [content] cover: ancient-greek-building excerpt: Did you know there's an easy way to create a descending list of numbered items with pure HTML? Learn how with this handy tip. +listed: true dateModified: 2021-06-22 --- diff --git a/content/snippets/html/s/start-ordered-list-at-different-number.md b/content/snippets/html/s/start-ordered-list-at-different-number.md index f22ecd4ff38..23de52e94b4 100644 --- a/content/snippets/html/s/start-ordered-list-at-different-number.md +++ b/content/snippets/html/s/start-ordered-list-at-different-number.md @@ -6,6 +6,7 @@ language: html tags: [content] cover: neon-desk-1 excerpt: Did you know you can customize the starting number of your ordered lists? Learn how with this quick tip. +listed: true dateModified: 2024-05-10 --- diff --git a/content/snippets/html/s/target-blank.md b/content/snippets/html/s/target-blank.md index da88401cf5f..03477dd852e 100644 --- a/content/snippets/html/s/target-blank.md +++ b/content/snippets/html/s/target-blank.md @@ -6,6 +6,7 @@ language: html tags: [link,security] cover: laptop-with-code excerpt: Opening a link in a new tab comes with a security vulnerability that you may not be aware of. Protect your users with this simple trick. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/html/s/zooming-accessibility-tips.md b/content/snippets/html/s/zooming-accessibility-tips.md index 05161ffed81..3650ebf0a7e 100644 --- a/content/snippets/html/s/zooming-accessibility-tips.md +++ b/content/snippets/html/s/zooming-accessibility-tips.md @@ -6,7 +6,7 @@ language: html tags: [accessibility,metadata,head] cover: camera-zoom excerpt: Using the viewport meta tag incorrectly can harm your website's accessibility. Learn how to prevent problems with this handy guide. -unlisted: true +listed: false dateModified: 2021-06-12 --- diff --git a/content/snippets/html/snippet-template.md b/content/snippets/html/snippet-template.md index e3933cd0990..9ae893ee035 100644 --- a/content/snippets/html/snippet-template.md +++ b/content/snippets/html/snippet-template.md @@ -6,6 +6,7 @@ language: html tags: [link] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/js/s/10-vs-code-extensions-for-js-developers.md b/content/snippets/js/s/10-vs-code-extensions-for-js-developers.md index a3df839d916..e380483df56 100644 --- a/content/snippets/js/s/10-vs-code-extensions-for-js-developers.md +++ b/content/snippets/js/s/10-vs-code-extensions-for-js-developers.md @@ -6,7 +6,7 @@ language: javascript tags: [devtools,vscode] cover: computer-screens excerpt: Boost your productivity with these 10 essential VS Code extensions for JavaScript developers. -unlisted: true +listed: false dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/4-array-methods.md b/content/snippets/js/s/4-array-methods.md index 3697d69ea2b..9d83dc05104 100644 --- a/content/snippets/js/s/4-array-methods.md +++ b/content/snippets/js/s/4-array-methods.md @@ -6,6 +6,7 @@ language: javascript tags: [array,cheatsheet] cover: arrays excerpt: JavaScript arrays have a very robust API offering some amazing tools. Learn the 4 must-know JavaScript array methods in this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/6-regexp-tricks.md b/content/snippets/js/s/6-regexp-tricks.md index be0c069e7cf..f977917d05a 100644 --- a/content/snippets/js/s/6-regexp-tricks.md +++ b/content/snippets/js/s/6-regexp-tricks.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: taking-photos excerpt: Learn how to effectively use JavaScript regular expressions with these 6 powerful features. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/abort-fetch.md b/content/snippets/js/s/abort-fetch.md index 21636fa7590..619298c728b 100644 --- a/content/snippets/js/s/abort-fetch.md +++ b/content/snippets/js/s/abort-fetch.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: cancel-typographer excerpt: Aborting a fetch request in JavaScript is a common problem. Here's how to handle it correctly. +listed: true dateModified: 2022-05-15 --- diff --git a/content/snippets/js/s/add-event-listener-all.md b/content/snippets/js/s/add-event-listener-all.md index 77beee38f34..5a4da4af532 100644 --- a/content/snippets/js/s/add-event-listener-all.md +++ b/content/snippets/js/s/add-event-listener-all.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,event] cover: duck-plants +excerpt: Attaches an event listener to all the provided targets. +listed: true dateModified: 2021-04-22 --- diff --git a/content/snippets/js/s/add-key-value-pair-to-object.md b/content/snippets/js/s/add-key-value-pair-to-object.md index fdb6e6e6c7c..83493c4fc29 100644 --- a/content/snippets/js/s/add-key-value-pair-to-object.md +++ b/content/snippets/js/s/add-key-value-pair-to-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: pineapple-laptop excerpt: Adding a key-value pair to a JavaScript object is straightforward, yet there are multiple ways available to do so. +listed: true dateModified: 2022-07-21 --- diff --git a/content/snippets/js/s/add-minutes-hours-days-to-date.md b/content/snippets/js/s/add-minutes-hours-days-to-date.md index 2fe5460e10c..fbf24587c75 100644 --- a/content/snippets/js/s/add-minutes-hours-days-to-date.md +++ b/content/snippets/js/s/add-minutes-hours-days-to-date.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: orange-coffee-4 excerpt: Learn how to manipulate `Date` objects to add minutes, hours, days and more. +listed: true dateModified: 2024-01-05 --- diff --git a/content/snippets/js/s/add-multiple-event-listeners.md b/content/snippets/js/s/add-multiple-event-listeners.md index 85ba895f3e5..ca47f57ac2d 100644 --- a/content/snippets/js/s/add-multiple-event-listeners.md +++ b/content/snippets/js/s/add-multiple-event-listeners.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,event] cover: compass-1 +excerpt: Adds multiple event listeners with the same handler to an element. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/add-remove-event-listener.md b/content/snippets/js/s/add-remove-event-listener.md index 667bf3c8957..424f25ba3a5 100644 --- a/content/snippets/js/s/add-remove-event-listener.md +++ b/content/snippets/js/s/add-remove-event-listener.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: wooden-bowl excerpt: Learn how to add or remove event listeners from elements with ease. +listed: true dateModified: 2023-10-28 --- diff --git a/content/snippets/js/s/all-values-of-array-are-equal.md b/content/snippets/js/s/all-values-of-array-are-equal.md index 8f56eac1d34..0a6440b0585 100644 --- a/content/snippets/js/s/all-values-of-array-are-equal.md +++ b/content/snippets/js/s/all-values-of-array-are-equal.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: book-stopper excerpt: Use the `Array.prototype.every()` method to check if all values of an array are equal in JavaScript. +listed: true dateModified: 2024-02-16 --- diff --git a/content/snippets/js/s/append-elements-to-array.md b/content/snippets/js/s/append-elements-to-array.md index c8ef8b5cfdb..23cc06e52cb 100644 --- a/content/snippets/js/s/append-elements-to-array.md +++ b/content/snippets/js/s/append-elements-to-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: switzerland-night excerpt: Have you ever tried appending elements to an array in JavaScript? Here's a primer on all the available options. +listed: true dateModified: 2022-07-10 --- diff --git a/content/snippets/js/s/approximately-equal.md b/content/snippets/js/s/approximately-equal.md index 5a4b8c23877..a8ff5b7d1eb 100644 --- a/content/snippets/js/s/approximately-equal.md +++ b/content/snippets/js/s/approximately-equal.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: female-hiker excerpt: Learn how to check if two numbers are approximately equal to each other in JavaScript. +listed: true dateModified: 2024-02-04 --- diff --git a/content/snippets/js/s/arithmetic-and-geometric-progression.md b/content/snippets/js/s/arithmetic-and-geometric-progression.md index 4154f4bcc34..7112219e7c1 100644 --- a/content/snippets/js/s/arithmetic-and-geometric-progression.md +++ b/content/snippets/js/s/arithmetic-and-geometric-progression.md @@ -6,6 +6,7 @@ language: javascript tags: [math,algorithm] cover: half-trees excerpt: Create arrays of numbers in arithmetic and geometric progression. +listed: true dateModified: 2024-02-16 --- diff --git a/content/snippets/js/s/array-comparison.md b/content/snippets/js/s/array-comparison.md index 84644b42e39..4e1f77a6a06 100644 --- a/content/snippets/js/s/array-comparison.md +++ b/content/snippets/js/s/array-comparison.md @@ -6,6 +6,7 @@ language: javascript tags: [array,comparison] cover: coconuts excerpt: Learn how you can compare two arrays in JavaScript using various different techniques. +listed: true dateModified: 2021-09-27 --- diff --git a/content/snippets/js/s/array-filtering-tips.md b/content/snippets/js/s/array-filtering-tips.md index 6b567e34c34..8fc6694f7ca 100644 --- a/content/snippets/js/s/array-filtering-tips.md +++ b/content/snippets/js/s/array-filtering-tips.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: rocky-beach-waves excerpt: A few tips and tricks to help you filter arrays in JavaScript more efficiently. +listed: true dateModified: 2022-09-28 --- diff --git a/content/snippets/js/s/array-has-only-one-match-or-many.md b/content/snippets/js/s/array-has-only-one-match-or-many.md index cec74779702..3d260e36579 100644 --- a/content/snippets/js/s/array-has-only-one-match-or-many.md +++ b/content/snippets/js/s/array-has-only-one-match-or-many.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: interior-10 excerpt: Learn how to check if an array has one or more values matching the given function, and how to find the matching elements. +listed: true dateModified: 2024-01-30 --- diff --git a/content/snippets/js/s/array-head-tail.md b/content/snippets/js/s/array-head-tail.md index f7874402ffe..8160a783bfa 100644 --- a/content/snippets/js/s/array-head-tail.md +++ b/content/snippets/js/s/array-head-tail.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: clay-pot-horizon excerpt: Find the head or tail of a JavaScript array without mutating it. +listed: true dateModified: 2023-10-08 --- diff --git a/content/snippets/js/s/array-includes-any-or-all-values.md b/content/snippets/js/s/array-includes-any-or-all-values.md index d4b30a7d12e..7b9df1cc6c0 100644 --- a/content/snippets/js/s/array-includes-any-or-all-values.md +++ b/content/snippets/js/s/array-includes-any-or-all-values.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: tomatoes excerpt: Check if any or all the elements in an array are included in another array. +listed: true dateModified: 2024-01-13 --- diff --git a/content/snippets/js/s/array-includes-value.md b/content/snippets/js/s/array-includes-value.md index 6e2e6fe2551..9874a0f1384 100644 --- a/content/snippets/js/s/array-includes-value.md +++ b/content/snippets/js/s/array-includes-value.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: bridge-drop excerpt: Checking if an array includes a specific value is pretty straightforward, except when it comes to objects. +listed: true dateModified: 2022-09-18 --- diff --git a/content/snippets/js/s/array-initialization.md b/content/snippets/js/s/array-initialization.md index 831e12f1560..9f1354efd5e 100644 --- a/content/snippets/js/s/array-initialization.md +++ b/content/snippets/js/s/array-initialization.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: red-mountain-range excerpt: Discover the inner workings of JavaScript arrays and learn about the different ways to initialize them. +listed: true dateModified: 2023-06-18 --- diff --git a/content/snippets/js/s/array-is-sorted.md b/content/snippets/js/s/array-is-sorted.md index 13daad7e742..d1f88ead12b 100644 --- a/content/snippets/js/s/array-is-sorted.md +++ b/content/snippets/js/s/array-is-sorted.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: italian-horizon excerpt: Efficiently check if a numeric array is sorted in ascending or descending order in JavaScript. +listed: true dateModified: 2024-02-15 --- diff --git a/content/snippets/js/s/array-map-vs-foreach.md b/content/snippets/js/s/array-map-vs-foreach.md index c61013ffe2b..a61cf602205 100644 --- a/content/snippets/js/s/array-map-vs-foreach.md +++ b/content/snippets/js/s/array-map-vs-foreach.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: fort-lamp excerpt: Which method do you reach for first? What are the differences between them? Let's find out! +listed: true dateModified: 2023-03-26 --- diff --git a/content/snippets/js/s/array-min-max.md b/content/snippets/js/s/array-min-max.md index eaa844fa116..1cd8c4a21a4 100644 --- a/content/snippets/js/s/array-min-max.md +++ b/content/snippets/js/s/array-min-max.md @@ -6,6 +6,7 @@ language: javascript tags: [array,math] cover: little-tree excerpt: When working with JavaScript arrays, you might need the minimum or maximum value. Here are a few quick and easy ways to do it. +listed: true dateModified: 2023-12-30 --- diff --git a/content/snippets/js/s/array-or-string-permutations.md b/content/snippets/js/s/array-or-string-permutations.md index e318cb512b9..0dbc1c6812f 100644 --- a/content/snippets/js/s/array-or-string-permutations.md +++ b/content/snippets/js/s/array-or-string-permutations.md @@ -6,6 +6,7 @@ language: javascript tags: [array,string,recursion] cover: body-of-water excerpt: Generate all permutations of an array's elements or a string's characters using recursion. +listed: true dateModified: 2024-02-09 --- diff --git a/content/snippets/js/s/array-ranking.md b/content/snippets/js/s/array-ranking.md index e32d2e056e9..2347956b3c2 100644 --- a/content/snippets/js/s/array-ranking.md +++ b/content/snippets/js/s/array-ranking.md @@ -6,6 +6,7 @@ language: javascript tags: [array,math] cover: eagle excerpt: Calculate the ranking of an array based on a comparator function in JavaScript. +listed: true dateModified: 2024-02-16 --- diff --git a/content/snippets/js/s/array-sample-shuffle-weighted-selection.md b/content/snippets/js/s/array-sample-shuffle-weighted-selection.md index 0539bd20436..48db6e6d520 100644 --- a/content/snippets/js/s/array-sample-shuffle-weighted-selection.md +++ b/content/snippets/js/s/array-sample-shuffle-weighted-selection.md @@ -6,6 +6,7 @@ language: javascript tags: [array,random] cover: blue-bench excerpt: Learn how to shuffle, sample and perform weighted selection on JavaScript arrays. +listed: true dateModified: 2024-03-15 --- diff --git a/content/snippets/js/s/array-set-operations.md b/content/snippets/js/s/array-set-operations.md index 4ec70bd659f..e3e64cb7e99 100644 --- a/content/snippets/js/s/array-set-operations.md +++ b/content/snippets/js/s/array-set-operations.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: dim-mountains excerpt: Explore how you can apply mathematical set operations to JavaScript `Set` objects and arrays. +listed: true dateModified: 2024-01-01 --- diff --git a/content/snippets/js/s/array-sorting-shorthand.md b/content/snippets/js/s/array-sorting-shorthand.md index 6b3b1a67b0e..0229c3f0540 100644 --- a/content/snippets/js/s/array-sorting-shorthand.md +++ b/content/snippets/js/s/array-sorting-shorthand.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: apples excerpt: Learn how to quickly write code to sort JavaScript arrays with this handy one-liner. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/array-stable-sort.md b/content/snippets/js/s/array-stable-sort.md index 7e7d916451c..5ad0d645cff 100644 --- a/content/snippets/js/s/array-stable-sort.md +++ b/content/snippets/js/s/array-stable-sort.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: horse-sunset excerpt: Understand why JavaScript's built-in array sorting is not stable and how to implement a stable sorting algorithm. +listed: true dateModified: 2024-03-21 --- diff --git a/content/snippets/js/s/arrays-have-same-contents.md b/content/snippets/js/s/arrays-have-same-contents.md index a86458d818b..bd1eca91626 100644 --- a/content/snippets/js/s/arrays-have-same-contents.md +++ b/content/snippets/js/s/arrays-have-same-contents.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: interior-15 excerpt: Learn how to compare the contents of two arrays to see if they contain the same elements regardless of order. +listed: true dateModified: 2024-03-04 --- diff --git a/content/snippets/js/s/arrays-of-consecutive-elements.md b/content/snippets/js/s/arrays-of-consecutive-elements.md index 62fe446bb14..1f15a82d53d 100644 --- a/content/snippets/js/s/arrays-of-consecutive-elements.md +++ b/content/snippets/js/s/arrays-of-consecutive-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: camera-zoom excerpt: Create an array of `n`-tuples of consecutive elements from a given array. +listed: true dateModified: 2024-03-20 --- diff --git a/content/snippets/js/s/arrow-function-event-listeners.md b/content/snippets/js/s/arrow-function-event-listeners.md index 439445a5768..8b40b6f2023 100644 --- a/content/snippets/js/s/arrow-function-event-listeners.md +++ b/content/snippets/js/s/arrow-function-event-listeners.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event,function] cover: coffee-float excerpt: Learn the differences between JavaScript ES6 arrow functions and regular functions and how they affect event listener callbacks. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/arrow-functions.md b/content/snippets/js/s/arrow-functions.md index 9740eb97790..2791bd0ca5f 100644 --- a/content/snippets/js/s/arrow-functions.md +++ b/content/snippets/js/s/arrow-functions.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: arrow-functions excerpt: JavaScript arrow functions are a very useful tool to learn and master. Here's a complete introduction to everything you need to know. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/arrow-regular-function-differences.md b/content/snippets/js/s/arrow-regular-function-differences.md index 47754e3e5fb..13e3c239a62 100644 --- a/content/snippets/js/s/arrow-regular-function-differences.md +++ b/content/snippets/js/s/arrow-regular-function-differences.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: fallen-leaves excerpt: JavaScript's arrow functions are seemingly the same as regular functions, but there are some important differences you need to know. +listed: true dateModified: 2021-10-17 --- diff --git a/content/snippets/js/s/async-array-loops.md b/content/snippets/js/s/async-array-loops.md index 42d2cff299f..ac32efd0053 100644 --- a/content/snippets/js/s/async-array-loops.md +++ b/content/snippets/js/s/async-array-loops.md @@ -6,6 +6,7 @@ language: javascript tags: [array,function,promise] cover: sunflowers excerpt: Asynchronously looping over arrays in JavaScript comes with a few caveats you should watch out for. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/async-cheatsheet.md b/content/snippets/js/s/async-cheatsheet.md index fdd1430232b..a74cfd01402 100644 --- a/content/snippets/js/s/async-cheatsheet.md +++ b/content/snippets/js/s/async-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [function,promise,cheatsheet] cover: green-plant excerpt: Learn everything you need to know about promises and asynchronous JavaScript with this handy cheatsheet. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/attempt-invoking-function.md b/content/snippets/js/s/attempt-invoking-function.md index 2f0f87876b3..615e1cbe2d4 100644 --- a/content/snippets/js/s/attempt-invoking-function.md +++ b/content/snippets/js/s/attempt-invoking-function.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: spanish-resort +excerpt: Attempts to invoke a function with the provided arguments, returning either the result or the caught error object. +listed: true dateModified: 2020-10-18 --- diff --git a/content/snippets/js/s/await-timeout.md b/content/snippets/js/s/await-timeout.md index 3a00097be9f..2387abc0323 100644 --- a/content/snippets/js/s/await-timeout.md +++ b/content/snippets/js/s/await-timeout.md @@ -6,6 +6,7 @@ language: javascript tags: [promise,timeout,class] cover: walking excerpt: Oftentimes you might need to add a timeout to a promise in JavaScript. Learn how to do this and more in this short guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/bifurcate-array.md b/content/snippets/js/s/bifurcate-array.md index 2669f550608..4cc0d6a39bb 100644 --- a/content/snippets/js/s/bifurcate-array.md +++ b/content/snippets/js/s/bifurcate-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: canoe excerpt: Learn how to split a JavaScript array into two groups based on a function or an array of values. +listed: true dateModified: 2023-10-09 --- diff --git a/content/snippets/js/s/big-o-cheatsheet.md b/content/snippets/js/s/big-o-cheatsheet.md index 5f5deadb966..3b6db933860 100644 --- a/content/snippets/js/s/big-o-cheatsheet.md +++ b/content/snippets/js/s/big-o-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,cheatsheet] cover: light-ring excerpt: Learn everything you need to know about Big-O notation with this handy cheatsheet. +listed: true dateModified: 2023-01-08 --- diff --git a/content/snippets/js/s/binary-search.md b/content/snippets/js/s/binary-search.md index ba326a6415a..5191f04c2e9 100644 --- a/content/snippets/js/s/binary-search.md +++ b/content/snippets/js/s/binary-search.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [algorithm,array] cover: zen-indoors +excerpt: Finds the index of a given element in a sorted array using the binary search algorithm. +listed: true dateModified: 2020-12-29 --- diff --git a/content/snippets/js/s/binomial-coefficient.md b/content/snippets/js/s/binomial-coefficient.md index 277d203544e..64032f34b2e 100644 --- a/content/snippets/js/s/binomial-coefficient.md +++ b/content/snippets/js/s/binomial-coefficient.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math,algorithm] cover: blue-red-mountain +excerpt: Calculates the number of ways to choose `k` items from `n` items without repetition and without order. +listed: true dateModified: 2020-12-28 --- diff --git a/content/snippets/js/s/blank-value.md b/content/snippets/js/s/blank-value.md index 2f23aec8753..ed8348c4c9f 100644 --- a/content/snippets/js/s/blank-value.md +++ b/content/snippets/js/s/blank-value.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: workspace-with-speaker excerpt: JavaScript doesn't have a built-in way to check if a value is blank, but it's easy to create one. +listed: true dateModified: 2022-09-25 --- diff --git a/content/snippets/js/s/boolean-function.md b/content/snippets/js/s/boolean-function.md index 60a3b789ccc..786bddad8d2 100644 --- a/content/snippets/js/s/boolean-function.md +++ b/content/snippets/js/s/boolean-function.md @@ -6,6 +6,7 @@ language: javascript tags: [function,type] cover: rocky-lake excerpt: JavaScript's Boolean function can be used for truth-checking data among other things. Learn how to use it and level up your code today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/boolean-trap.md b/content/snippets/js/s/boolean-trap.md index eea7383b98b..4da989b32af 100644 --- a/content/snippets/js/s/boolean-trap.md +++ b/content/snippets/js/s/boolean-trap.md @@ -6,6 +6,7 @@ language: javascript tags: [function,type,boolean] cover: lighthouse excerpt: Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article. +listed: true dateModified: 2021-07-11 --- diff --git a/content/snippets/js/s/bottom-visible.md b/content/snippets/js/s/bottom-visible.md index c7035485a9e..968fb6bab14 100644 --- a/content/snippets/js/s/bottom-visible.md +++ b/content/snippets/js/s/bottom-visible.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: hiking-walking excerpt: If you've ever needed to check if the bottom of the page is visible, this snippet will help you do just that. +listed: true dateModified: 2024-06-01 --- diff --git a/content/snippets/js/s/bubble-sort.md b/content/snippets/js/s/bubble-sort.md index 72cb102442b..3371f01b9ab 100644 --- a/content/snippets/js/s/bubble-sort.md +++ b/content/snippets/js/s/bubble-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array] cover: sail-away-2 excerpt: Sort an array of numbers, using the bubble sort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/bucket-sort.md b/content/snippets/js/s/bucket-sort.md index 710b02e79ea..0a8b60ec140 100644 --- a/content/snippets/js/s/bucket-sort.md +++ b/content/snippets/js/s/bucket-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array] cover: canoe excerpt: Sort an array of numbers, using the bucket sort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/byte-size.md b/content/snippets/js/s/byte-size.md index 83cf55c5217..c7cec421f44 100644 --- a/content/snippets/js/s/byte-size.md +++ b/content/snippets/js/s/byte-size.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: mountain-lake-cottage-2 excerpt: Figure out the exact number of bytes in a JavaScript string, including Unicode characters. +listed: true dateModified: 2024-03-09 --- diff --git a/content/snippets/js/s/caesar-cipher.md b/content/snippets/js/s/caesar-cipher.md index c2991ec78f6..328abfefa6b 100644 --- a/content/snippets/js/s/caesar-cipher.md +++ b/content/snippets/js/s/caesar-cipher.md @@ -6,6 +6,7 @@ language: javascript tags: [algorithm,string] cover: waves-from-above excerpt: The Caesar cipher is a simple substitution cipher, which can be easily implemented with a few lines of JavaScript code. +listed: true dateModified: 2023-12-17 --- diff --git a/content/snippets/js/s/call-function-once.md b/content/snippets/js/s/call-function-once.md index 36d88a1e749..001987e2548 100644 --- a/content/snippets/js/s/call-function-once.md +++ b/content/snippets/js/s/call-function-once.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: pink-flower-tree +excerpt: Ensures a function is called only once. +listed: true dateModified: 2020-10-21 --- diff --git a/content/snippets/js/s/callback-pitfalls.md b/content/snippets/js/s/callback-pitfalls.md index 1858f8bddc0..71a02df80bd 100644 --- a/content/snippets/js/s/callback-pitfalls.md +++ b/content/snippets/js/s/callback-pitfalls.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: rabbit-call excerpt: JavaScript callbacks are especially tricky when you're not careful. Take a deeper dive into potential issues and how to avoid them. +listed: true dateModified: 2021-07-01 --- diff --git a/content/snippets/js/s/callbacks.md b/content/snippets/js/s/callbacks.md index 04111bb9961..76f1af760b2 100644 --- a/content/snippets/js/s/callbacks.md +++ b/content/snippets/js/s/callbacks.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: rabbit-call excerpt: JavaScript uses callback functions quite a lot. From event listeners to asynchronous code, they're an invaluable tool you need to master. +listed: true dateModified: 2021-10-03 --- diff --git a/content/snippets/js/s/cannot-extend-proxy-object.md b/content/snippets/js/s/cannot-extend-proxy-object.md index be9edbf4e31..cea872ecdff 100644 --- a/content/snippets/js/s/cannot-extend-proxy-object.md +++ b/content/snippets/js/s/cannot-extend-proxy-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy] cover: icebreaker excerpt: Turns out the Proxy object is not extensible, but there's a way around its limitations. +listed: true dateModified: 2023-04-17 --- diff --git a/content/snippets/js/s/capitalize-first-letter-of-string.md b/content/snippets/js/s/capitalize-first-letter-of-string.md index 7518d9bab71..33fbc568b62 100644 --- a/content/snippets/js/s/capitalize-first-letter-of-string.md +++ b/content/snippets/js/s/capitalize-first-letter-of-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: digital-nomad-3 excerpt: Learn how to capitalize the first letter of a string in JavaScript using array destructuring and `String.prototype.toUpperCase()`. +listed: true dateModified: 2023-12-13 --- diff --git a/content/snippets/js/s/cartesian-product-of-arrays.md b/content/snippets/js/s/cartesian-product-of-arrays.md index 5e7ec2cc1ed..fe02ee5e983 100644 --- a/content/snippets/js/s/cartesian-product-of-arrays.md +++ b/content/snippets/js/s/cartesian-product-of-arrays.md @@ -6,6 +6,7 @@ language: javascript tags: [math,array] cover: cup-of-orange excerpt: Create a new array out of the two supplied by creating each possible pair from the arrays. +listed: true dateModified: 2024-03-20 --- diff --git a/content/snippets/js/s/change-lightness.md b/content/snippets/js/s/change-lightness.md index 2b4f591a0f6..c2e2ae40421 100644 --- a/content/snippets/js/s/change-lightness.md +++ b/content/snippets/js/s/change-lightness.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: aerial-view-port excerpt: Learn how to change the lightness component of an `hsl()` color string using JavaScript. +listed: true dateModified: 2024-02-04 --- diff --git a/content/snippets/js/s/check-array-values-are-truthy.md b/content/snippets/js/s/check-array-values-are-truthy.md index c9e26d12baa..2c4009d6170 100644 --- a/content/snippets/js/s/check-array-values-are-truthy.md +++ b/content/snippets/js/s/check-array-values-are-truthy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,logic,array] cover: digital-nomad-8 excerpt: Learn how to check if all values in an array are true or false. +listed: true dateModified: 2023-11-06 --- diff --git a/content/snippets/js/s/clamp-or-map-number-to-range.md b/content/snippets/js/s/clamp-or-map-number-to-range.md index 5f577fd3698..fab3125dea3 100644 --- a/content/snippets/js/s/clamp-or-map-number-to-range.md +++ b/content/snippets/js/s/clamp-or-map-number-to-range.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: clay-pot-horizon excerpt: Clamping and mapping a number to a range are two common and easily confused operations. Learn how to perform each in JavaScript. +listed: true dateModified: 2024-02-14 --- diff --git a/content/snippets/js/s/classical-vs-prototypal-inheritance.md b/content/snippets/js/s/classical-vs-prototypal-inheritance.md index 6281abd7898..48c71d3f4b6 100644 --- a/content/snippets/js/s/classical-vs-prototypal-inheritance.md +++ b/content/snippets/js/s/classical-vs-prototypal-inheritance.md @@ -6,6 +6,7 @@ language: javascript tags: [object,class] cover: last-light excerpt: Understanding the difference between these two object-oriented programming paradigms is key to taking your skills to the next level. +listed: true dateModified: 2021-11-21 --- diff --git a/content/snippets/js/s/closures.md b/content/snippets/js/s/closures.md index ce1f3eaba80..55717527219 100644 --- a/content/snippets/js/s/closures.md +++ b/content/snippets/js/s/closures.md @@ -6,6 +6,7 @@ language: javascript tags: [function,closure] cover: cherry-trees excerpt: Learn and understand closures, a core concept in JavaScript programming, and level up your code. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/code-anatomy-chaining-reduce-for-loop.md b/content/snippets/js/s/code-anatomy-chaining-reduce-for-loop.md index 4817a754b6f..4edd5a3a572 100644 --- a/content/snippets/js/s/code-anatomy-chaining-reduce-for-loop.md +++ b/content/snippets/js/s/code-anatomy-chaining-reduce-for-loop.md @@ -6,6 +6,7 @@ language: javascript tags: [array,iterator] cover: case-study excerpt: There are many ways to iterate and transform array data in JavaScript. Learn how each one works and where you should use them. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/code-anatomy-optimizing-recursion.md b/content/snippets/js/s/code-anatomy-optimizing-recursion.md index 6322fda8801..2fa9d0b3ed1 100644 --- a/content/snippets/js/s/code-anatomy-optimizing-recursion.md +++ b/content/snippets/js/s/code-anatomy-optimizing-recursion.md @@ -6,6 +6,7 @@ language: javascript tags: [recursion,performance] cover: case-study excerpt: Recursive code tends to be inefficient or in need of optimization. Learn a couple of tricks we use to speed up our recursive functions. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/collection-is-empty.md b/content/snippets/js/s/collection-is-empty.md index d1171a35dc6..10e7aa56b67 100644 --- a/content/snippets/js/s/collection-is-empty.md +++ b/content/snippets/js/s/collection-is-empty.md @@ -6,6 +6,7 @@ language: javascript tags: [type,array,object,string] cover: mountain-lake excerpt: Quickly determine if a collection of values is empty in JavaScript. +listed: true dateModified: 2024-06-10 --- diff --git a/content/snippets/js/s/color-console-output.md b/content/snippets/js/s/color-console-output.md index 8c2ed66809a..fd646f142f1 100644 --- a/content/snippets/js/s/color-console-output.md +++ b/content/snippets/js/s/color-console-output.md @@ -6,6 +6,7 @@ language: javascript tags: [node,string] cover: plant-corner excerpt: Use special Unicode characters to print text in color in the console. +listed: true dateModified: 2024-03-14 --- diff --git a/content/snippets/js/s/combine-object-arrays.md b/content/snippets/js/s/combine-object-arrays.md index d6e92ca4347..3c669030384 100644 --- a/content/snippets/js/s/combine-object-arrays.md +++ b/content/snippets/js/s/combine-object-arrays.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: digital-nomad-6 excerpt: Learn how to merge two arrays of objects, while combining objects based on a specified key. +listed: true dateModified: 2024-03-26 --- diff --git a/content/snippets/js/s/command-line-arguments.md b/content/snippets/js/s/command-line-arguments.md index 3b2b637f61a..8a873422500 100644 --- a/content/snippets/js/s/command-line-arguments.md +++ b/content/snippets/js/s/command-line-arguments.md @@ -6,6 +6,7 @@ language: javascript tags: [node] cover: hiking-balance excerpt: Learn how to extract command-line arguments passed to a Node.js script. +listed: true dateModified: 2024-05-22 --- diff --git a/content/snippets/js/s/common-regexp-cheatsheet.md b/content/snippets/js/s/common-regexp-cheatsheet.md index 6d7cb78d5e6..6f22484cee3 100644 --- a/content/snippets/js/s/common-regexp-cheatsheet.md +++ b/content/snippets/js/s/common-regexp-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [string,regexp,cheatsheet] cover: rocky-beach excerpt: A collection of regular expressions that can be used to solve common problems. +listed: true dateModified: 2022-11-09 --- diff --git a/content/snippets/js/s/compact-object-or-array.md b/content/snippets/js/s/compact-object-or-array.md index dc34ee505e8..ccd193dcb47 100644 --- a/content/snippets/js/s/compact-object-or-array.md +++ b/content/snippets/js/s/compact-object-or-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object,recursion] cover: basket-paper excerpt: Learn how to compact an array or object in JavaScript using the `Boolean` function and recursion. +listed: true dateModified: 2024-01-02 --- diff --git a/content/snippets/js/s/compare-string-case-accent-insensitive.md b/content/snippets/js/s/compare-string-case-accent-insensitive.md index 086781442a2..2308a28ad01 100644 --- a/content/snippets/js/s/compare-string-case-accent-insensitive.md +++ b/content/snippets/js/s/compare-string-case-accent-insensitive.md @@ -6,6 +6,7 @@ language: javascript tags: [string,comparison] cover: memories-of-pineapple-1 excerpt: Here's a quick tip on how to compare and sort arrays of strings, ignoring case and accents. +listed: true dateModified: 2022-07-17 --- diff --git a/content/snippets/js/s/complete-guide-to-js-type-checking.md b/content/snippets/js/s/complete-guide-to-js-type-checking.md index 18d73cdacae..a70748c0fc8 100644 --- a/content/snippets/js/s/complete-guide-to-js-type-checking.md +++ b/content/snippets/js/s/complete-guide-to-js-type-checking.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: overgrown excerpt: Learn all you need to know to effectively and efficiently typecheck values in JavaScript. +listed: true dateModified: 2023-12-22 --- diff --git a/content/snippets/js/s/console-log-cheatsheet.md b/content/snippets/js/s/console-log-cheatsheet.md index 60ab1a58b63..96af2d2f0aa 100644 --- a/content/snippets/js/s/console-log-cheatsheet.md +++ b/content/snippets/js/s/console-log-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [browser,cheatsheet] cover: terminal excerpt: Level up your JavaScript logging with these `console.log()` tips and tricks. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/construct-url.md b/content/snippets/js/s/construct-url.md index 1b81a76778c..6dc0d81311b 100644 --- a/content/snippets/js/s/construct-url.md +++ b/content/snippets/js/s/construct-url.md @@ -6,6 +6,7 @@ language: javascript tags: [string,browser] cover: alfama excerpt: A short guide on how to correctly construct a URL in JavaScript. +listed: true dateModified: 2023-02-26 --- diff --git a/content/snippets/js/s/convert-celsius-fahrenheit.md b/content/snippets/js/s/convert-celsius-fahrenheit.md index 4aa9cf662a0..041a00b9314 100644 --- a/content/snippets/js/s/convert-celsius-fahrenheit.md +++ b/content/snippets/js/s/convert-celsius-fahrenheit.md @@ -4,9 +4,9 @@ shortTitle: Convert between Celsius and Fahrenheit type: tip language: javascript tags: [math] -unlisted: true cover: golden-gate-bridge excerpt: Easily apply the Celsius to Fahrenheit and Fahrenheit to Celsius formulas. +listed: false dateModified: 2023-09-14 --- diff --git a/content/snippets/js/s/convert-csv-to-array-object-or-json.md b/content/snippets/js/s/convert-csv-to-array-object-or-json.md index c659ea7aff5..aa843eba134 100644 --- a/content/snippets/js/s/convert-csv-to-array-object-or-json.md +++ b/content/snippets/js/s/convert-csv-to-array-object-or-json.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object,string] cover: tropical-bike excerpt: Serialize and deserialize CSV data in JavaScript with this in-depth guide. +listed: true dateModified: 2024-06-08 --- diff --git a/content/snippets/js/s/convert-degrees-radians.md b/content/snippets/js/s/convert-degrees-radians.md index d797b87d9e3..a545e8dbad0 100644 --- a/content/snippets/js/s/convert-degrees-radians.md +++ b/content/snippets/js/s/convert-degrees-radians.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: blue-flower excerpt: Easily apply the degree to radian and radian to degree formulas. +listed: true dateModified: 2023-09-15 --- diff --git a/content/snippets/js/s/convert-map-to-object.md b/content/snippets/js/s/convert-map-to-object.md index a2a78adc61c..44949651121 100644 --- a/content/snippets/js/s/convert-map-to-object.md +++ b/content/snippets/js/s/convert-map-to-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: yellow-shoes excerpt: Learn how to convert between `Map`s and objects in JavaScript. +listed: true dateModified: 2024-02-11 --- diff --git a/content/snippets/js/s/convert-miles-km.md b/content/snippets/js/s/convert-miles-km.md index fadad11ef70..5b00d1ba455 100644 --- a/content/snippets/js/s/convert-miles-km.md +++ b/content/snippets/js/s/convert-miles-km.md @@ -4,9 +4,9 @@ shortTitle: Convert between miles and kilometers type: tip language: javascript tags: [math] -unlisted: true cover: rocky-beach-2 excerpt: Easily apply the mile to kilometer and kilometer to mile formulas. +listed: false dateModified: 2023-09-13 --- diff --git a/content/snippets/js/s/convert-to-absolute-path.md b/content/snippets/js/s/convert-to-absolute-path.md index ebca05bd339..1d246ec27ef 100644 --- a/content/snippets/js/s/convert-to-absolute-path.md +++ b/content/snippets/js/s/convert-to-absolute-path.md @@ -6,6 +6,7 @@ language: javascript tags: [node,string,regexp] cover: lighthouse excerpt: Ever wanted to convert a tilde path to an absolute path? Here's how you can do it in JavaScript. +listed: true dateModified: 2024-03-19 --- diff --git a/content/snippets/js/s/cookies-local-storage-session.md b/content/snippets/js/s/cookies-local-storage-session.md index 5501c4a4ce1..d8473ebcfd2 100644 --- a/content/snippets/js/s/cookies-local-storage-session.md +++ b/content/snippets/js/s/cookies-local-storage-session.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,webdev] cover: three-vases excerpt: Learn the difference between cookies, local storage and session storage and start using the correct option for your needs. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/copy-array.md b/content/snippets/js/s/copy-array.md index bd1030f5733..0d840202b66 100644 --- a/content/snippets/js/s/copy-array.md +++ b/content/snippets/js/s/copy-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: colorful-plastic excerpt: Pick up a few new tricks which you can use to clone arrays in JavaScript. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/copy-sign-to-number.md b/content/snippets/js/s/copy-sign-to-number.md index 0bbd80e19a7..19c496f9c61 100644 --- a/content/snippets/js/s/copy-sign-to-number.md +++ b/content/snippets/js/s/copy-sign-to-number.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: cloudy-mountaintop excerpt: Copy the sign of one number to another without changing its absolute value. +listed: true dateModified: 2024-05-28 --- diff --git a/content/snippets/js/s/copy-text-to-clipboard.md b/content/snippets/js/s/copy-text-to-clipboard.md index b262e1a2534..810338381ab 100644 --- a/content/snippets/js/s/copy-text-to-clipboard.md +++ b/content/snippets/js/s/copy-text-to-clipboard.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: typing excerpt: Learn how to programmatically copy text to clipboard with a few lines of JavaScript and level up your web development skills. +listed: true dateModified: 2024-01-13 --- diff --git a/content/snippets/js/s/cors-explained.md b/content/snippets/js/s/cors-explained.md index 53ef3b830d8..e338f5db4f2 100644 --- a/content/snippets/js/s/cors-explained.md +++ b/content/snippets/js/s/cors-explained.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,webdev] cover: chill-surfing excerpt: CORS (Cross-Origin Resource Sharing) trips up many developers, but it's pretty easy to wrap your head around. +listed: true dateModified: 2023-05-07 --- diff --git a/content/snippets/js/s/count-grouped-elements.md b/content/snippets/js/s/count-grouped-elements.md index ed09ce505b5..bd8e608e1de 100644 --- a/content/snippets/js/s/count-grouped-elements.md +++ b/content/snippets/js/s/count-grouped-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: tropical-waterfall excerpt: Learn how to group and count the values of a JavaScript array using simple array methods. +listed: true dateModified: 2024-01-28 --- diff --git a/content/snippets/js/s/count-occurrences.md b/content/snippets/js/s/count-occurrences.md index d456ea2adb0..82308ed2c9e 100644 --- a/content/snippets/js/s/count-occurrences.md +++ b/content/snippets/js/s/count-occurrences.md @@ -6,6 +6,7 @@ language: javascript tags: [array,string] cover: dark-leaves-4 excerpt: Given a value, find out how many times it appears in an array or string. +listed: true dateModified: 2024-05-14 --- diff --git a/content/snippets/js/s/create-directory-if-not-exists.md b/content/snippets/js/s/create-directory-if-not-exists.md index 538b4154396..6d7fe1d9414 100644 --- a/content/snippets/js/s/create-directory-if-not-exists.md +++ b/content/snippets/js/s/create-directory-if-not-exists.md @@ -6,6 +6,7 @@ language: javascript tags: [node] cover: misty-mountains excerpt: Learn how to create a directory using Node.js, if it doesn't exist. +listed: true dateModified: 2024-03-08 --- diff --git a/content/snippets/js/s/create-element.md b/content/snippets/js/s/create-element.md index 83a79caed7c..cfb21192985 100644 --- a/content/snippets/js/s/create-element.md +++ b/content/snippets/js/s/create-element.md @@ -5,6 +5,7 @@ language: javascript tags: [browser] cover: flower-portrait-4 excerpt: Creates an element from a string without appending it to the document. +listed: true dateModified: 2020-10-19 --- diff --git a/content/snippets/js/s/create-html-elements.md b/content/snippets/js/s/create-html-elements.md index 90ebf30be53..596cf1c32d1 100644 --- a/content/snippets/js/s/create-html-elements.md +++ b/content/snippets/js/s/create-html-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: body-of-water excerpt: Learn how to create HTML elements in JavaScript, by abstracting the creation logic into a function. +listed: true dateModified: 2022-05-29 --- diff --git a/content/snippets/js/s/current-url.md b/content/snippets/js/s/current-url.md index 992dbdb0e35..01e8b4909c5 100644 --- a/content/snippets/js/s/current-url.md +++ b/content/snippets/js/s/current-url.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: purple-sunset-waves excerpt: Learn a simple way to get the browser's current URL in JavaScript. +listed: true dateModified: 2023-10-19 --- diff --git a/content/snippets/js/s/currying.md b/content/snippets/js/s/currying.md index 4938006c6b2..3f6be26e3b1 100644 --- a/content/snippets/js/s/currying.md +++ b/content/snippets/js/s/currying.md @@ -6,6 +6,7 @@ language: javascript tags: [function,recursion] cover: tulips-and-reeds excerpt: Currying is a process that transforms a function that takes multiple arguments into a series of functions that each take a single argument. +listed: true dateModified: 2023-12-29 --- diff --git a/content/snippets/js/s/data-structures-binary-search-tree.md b/content/snippets/js/s/data-structures-binary-search-tree.md index 98284b01608..b2dbd5a0caf 100644 --- a/content/snippets/js/s/data-structures-binary-search-tree.md +++ b/content/snippets/js/s/data-structures-binary-search-tree.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-4 excerpt: A binary search tree is a hierarchical data structure of ordered nodes with at most two children each. +listed: true dateModified: 2021-08-31 --- diff --git a/content/snippets/js/s/data-structures-binary-tree.md b/content/snippets/js/s/data-structures-binary-tree.md index 964e56f76ad..c8e7ef50448 100644 --- a/content/snippets/js/s/data-structures-binary-tree.md +++ b/content/snippets/js/s/data-structures-binary-tree.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-3 excerpt: A binary tree is a hierarchical data structure of linked nodes with at most two children each. +listed: true dateModified: 2021-08-26 --- diff --git a/content/snippets/js/s/data-structures-doubly-linked-list.md b/content/snippets/js/s/data-structures-doubly-linked-list.md index 8f5a977881c..abf469a0cf1 100644 --- a/content/snippets/js/s/data-structures-doubly-linked-list.md +++ b/content/snippets/js/s/data-structures-doubly-linked-list.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-4 excerpt: A doubly linked list is a linear data structure where each element points both to the next and the previous one. +listed: true dateModified: 2021-08-12 --- diff --git a/content/snippets/js/s/data-structures-graph.md b/content/snippets/js/s/data-structures-graph.md index 5549b20c37d..0c15e74ff62 100644 --- a/content/snippets/js/s/data-structures-graph.md +++ b/content/snippets/js/s/data-structures-graph.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-1 excerpt: A graph is a data structure consisting of a set of vertices connected by a set of edges. +listed: true dateModified: 2021-08-17 --- diff --git a/content/snippets/js/s/data-structures-linked-list.md b/content/snippets/js/s/data-structures-linked-list.md index 03230a9d31a..257681b5dfc 100644 --- a/content/snippets/js/s/data-structures-linked-list.md +++ b/content/snippets/js/s/data-structures-linked-list.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-3 excerpt: A linked list is a linear data structure where each element points to the next. +listed: true dateModified: 2021-08-08 --- diff --git a/content/snippets/js/s/data-structures-queue.md b/content/snippets/js/s/data-structures-queue.md index df1ac2c46ae..d14bc470def 100644 --- a/content/snippets/js/s/data-structures-queue.md +++ b/content/snippets/js/s/data-structures-queue.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-2 excerpt: A queue is a linear data structure which follows a first in, first out (FIFO) order of operations. +listed: true dateModified: 2021-07-29 --- diff --git a/content/snippets/js/s/data-structures-stack.md b/content/snippets/js/s/data-structures-stack.md index 7b712840dec..524868d7fa5 100644 --- a/content/snippets/js/s/data-structures-stack.md +++ b/content/snippets/js/s/data-structures-stack.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-1 excerpt: A stack is a linear data structure which follows a last in, first out (LIFO) order of operations. +listed: true dateModified: 2021-08-03 --- diff --git a/content/snippets/js/s/data-structures-tree.md b/content/snippets/js/s/data-structures-tree.md index 74167899e5e..46615f62157 100644 --- a/content/snippets/js/s/data-structures-tree.md +++ b/content/snippets/js/s/data-structures-tree.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: purple-flower-macro-2 excerpt: A tree is a data structure consisting of a set of linked nodes representing a hierarchical tree structure. +listed: true dateModified: 2021-08-22 --- diff --git a/content/snippets/js/s/date-comparison.md b/content/snippets/js/s/date-comparison.md index a9cbc1fe764..eef6199f446 100644 --- a/content/snippets/js/s/date-comparison.md +++ b/content/snippets/js/s/date-comparison.md @@ -6,6 +6,7 @@ language: javascript tags: [date,comparison] cover: pineapple-at-work excerpt: Learn how you can compare two dates in JavaScript, determining which one comes before or after the other. +listed: true dateModified: 2024-01-06 --- diff --git a/content/snippets/js/s/date-difference.md b/content/snippets/js/s/date-difference.md index 2a52ddd8225..effdd94b528 100644 --- a/content/snippets/js/s/date-difference.md +++ b/content/snippets/js/s/date-difference.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: laptop-journey excerpt: Learn how to calculate date difference in seconds, minutes, hours, days etc. in vanilla JavaScript. +listed: true dateModified: 2024-01-06 --- diff --git a/content/snippets/js/s/date-inside-business-hours.md b/content/snippets/js/s/date-inside-business-hours.md index 57b6acc6b4f..14e3b79b768 100644 --- a/content/snippets/js/s/date-inside-business-hours.md +++ b/content/snippets/js/s/date-inside-business-hours.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: shelf-plant excerpt: Leverage the `Date` object to check if a given date is inside business hours. +listed: true dateModified: 2024-03-13 --- diff --git a/content/snippets/js/s/date-is-weekday-or-weekend.md b/content/snippets/js/s/date-is-weekday-or-weekend.md index 5c68c5eb9c4..d08b7b5037a 100644 --- a/content/snippets/js/s/date-is-weekday-or-weekend.md +++ b/content/snippets/js/s/date-is-weekday-or-weekend.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: tropical-bike excerpt: Quickly and easily determine if a given JavaScript `Date` object is a weekday or weekend. +listed: true dateModified: 2024-01-06 --- diff --git a/content/snippets/js/s/date-range-generator.md b/content/snippets/js/s/date-range-generator.md index 42f8d60cba7..d1d0de5f444 100644 --- a/content/snippets/js/s/date-range-generator.md +++ b/content/snippets/js/s/date-range-generator.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [date,function,generator] cover: portal-timelapse +excerpt: Creates a generator, that generates all dates in the given range using the given step. +listed: true dateModified: 2021-06-21 --- diff --git a/content/snippets/js/s/date-to-unix-timestamp.md b/content/snippets/js/s/date-to-unix-timestamp.md index bb11592fff4..91ffcc3bbe5 100644 --- a/content/snippets/js/s/date-to-unix-timestamp.md +++ b/content/snippets/js/s/date-to-unix-timestamp.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: number-2 excerpt: Easily convert between a JavaScript Date object and a Unix timestamp. +listed: true dateModified: 2024-01-07 --- diff --git a/content/snippets/js/s/date-yesterday-today-tomorrow.md b/content/snippets/js/s/date-yesterday-today-tomorrow.md index 08525b99515..e98244f322d 100644 --- a/content/snippets/js/s/date-yesterday-today-tomorrow.md +++ b/content/snippets/js/s/date-yesterday-today-tomorrow.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: travel-mug-2 excerpt: Easily calculate the date of yesterday, today or tomorrow in JavaScript. +listed: true dateModified: 2024-01-06 --- diff --git a/content/snippets/js/s/day-week-month-quarter-of-year.md b/content/snippets/js/s/day-week-month-quarter-of-year.md index d350d61954c..38e9cfeb210 100644 --- a/content/snippets/js/s/day-week-month-quarter-of-year.md +++ b/content/snippets/js/s/day-week-month-quarter-of-year.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: godray-computer-mug excerpt: Determine the day, week, month, or quarter of the year that a date corresponds to, using vanilla JavaScript. +listed: true dateModified: 2024-01-05 --- diff --git a/content/snippets/js/s/days-ago-days-from-today.md b/content/snippets/js/s/days-ago-days-from-today.md index 97c5c2769d8..a260da4a222 100644 --- a/content/snippets/js/s/days-ago-days-from-today.md +++ b/content/snippets/js/s/days-ago-days-from-today.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: orange-wedges excerpt: Calculate the date of `n` days ago from today or the date of `n` days from now. +listed: true dateModified: 2024-01-07 --- diff --git a/content/snippets/js/s/days-in-month.md b/content/snippets/js/s/days-in-month.md index 661d86f7354..c1f5b8daa7c 100644 --- a/content/snippets/js/s/days-in-month.md +++ b/content/snippets/js/s/days-in-month.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: laptop-plants-2 excerpt: Calculate the number of days in a month for a given year using JavaScript. +listed: true dateModified: 2024-02-26 --- diff --git a/content/snippets/js/s/debounce-function.md b/content/snippets/js/s/debounce-function.md index 3b9fc86cb39..bef809ef6ab 100644 --- a/content/snippets/js/s/debounce-function.md +++ b/content/snippets/js/s/debounce-function.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: solitude-beach excerpt: Create a debounced function that waits a certain amount of time before invoking the provided function again. +listed: true dateModified: 2023-10-12 --- diff --git a/content/snippets/js/s/debounce-promise.md b/content/snippets/js/s/debounce-promise.md index 2c50ca09f8f..33dee2d34db 100644 --- a/content/snippets/js/s/debounce-promise.md +++ b/content/snippets/js/s/debounce-promise.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] excerpt: Easily create a debounced function that returns a promise. cover: chess-pawns +listed: true dateModified: 2023-10-13 --- diff --git a/content/snippets/js/s/decimal-to-hex.md b/content/snippets/js/s/decimal-to-hex.md index 453a85492a5..bbcbf5c5fd7 100644 --- a/content/snippets/js/s/decimal-to-hex.md +++ b/content/snippets/js/s/decimal-to-hex.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: waves-from-above excerpt: Ever needed to convert a decimal number to hexadecimal? Here's a quick and easy way to do it. +listed: true dateModified: 2022-09-21 --- diff --git a/content/snippets/js/s/deep-equality-comparison.md b/content/snippets/js/s/deep-equality-comparison.md index 740540585f7..caefef39541 100644 --- a/content/snippets/js/s/deep-equality-comparison.md +++ b/content/snippets/js/s/deep-equality-comparison.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [object,array,type,recursion] cover: dying-flowers +excerpt: Performs a deep comparison between two values to determine if they are equivalent. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/js/s/deep-freeze-object.md b/content/snippets/js/s/deep-freeze-object.md index 2ffc804c2cd..78b5a8fffbf 100644 --- a/content/snippets/js/s/deep-freeze-object.md +++ b/content/snippets/js/s/deep-freeze-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object,recursion] cover: frozen-globe excerpt: Learn how mutability works in JavaScript, its applications to objects and how you can properly freeze them to make them constant. +listed: true dateModified: 2024-06-04 --- diff --git a/content/snippets/js/s/default-values-for-object-properties.md b/content/snippets/js/s/default-values-for-object-properties.md index a05050a7085..b5e73bd34c7 100644 --- a/content/snippets/js/s/default-values-for-object-properties.md +++ b/content/snippets/js/s/default-values-for-object-properties.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [object] cover: filter-coffee-pot +excerpt: Assigns default values for all properties in an object that are `undefined`. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/defer-function.md b/content/snippets/js/s/defer-function.md index e9d6dc3b26c..3cf08e1d0fd 100644 --- a/content/snippets/js/s/defer-function.md +++ b/content/snippets/js/s/defer-function.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: shiny-mountains +excerpt: Defers invoking a function until the current call stack has cleared. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/destructuring-assignment.md b/content/snippets/js/s/destructuring-assignment.md index 42f55556b6b..6660a33992c 100644 --- a/content/snippets/js/s/destructuring-assignment.md +++ b/content/snippets/js/s/destructuring-assignment.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: building-blocks excerpt: Learn the basics of the destructuring assignment syntax in JavaScript ES6 and improve your code with this easy guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/detect-caps-lock-is-on.md b/content/snippets/js/s/detect-caps-lock-is-on.md index 22fd52e97d4..2013dccc6f6 100644 --- a/content/snippets/js/s/detect-caps-lock-is-on.md +++ b/content/snippets/js/s/detect-caps-lock-is-on.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: keyboard excerpt: If you need to check if Caps Lock is on when the user is typing in the browser, JavaScript's got you covered. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/detect-device-type.md b/content/snippets/js/s/detect-device-type.md index 8b599889497..5815e279b79 100644 --- a/content/snippets/js/s/detect-device-type.md +++ b/content/snippets/js/s/detect-device-type.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,regexp] cover: clutter-2 excerpt: Learn how to detect whether a page is being viewed on a mobile device or a desktop. +listed: true dateModified: 2024-06-03 --- diff --git a/content/snippets/js/s/detect-undefined-object-property.md b/content/snippets/js/s/detect-undefined-object-property.md index 9356e76a78a..15b5ae37ba7 100644 --- a/content/snippets/js/s/detect-undefined-object-property.md +++ b/content/snippets/js/s/detect-undefined-object-property.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: pink-flower excerpt: Learn how to detect `undefined` object properties in JavaScript the correct way. +listed: true dateModified: 2022-08-07 --- diff --git a/content/snippets/js/s/digitize-number.md b/content/snippets/js/s/digitize-number.md index fa849633fc1..47c1a0aa914 100644 --- a/content/snippets/js/s/digitize-number.md +++ b/content/snippets/js/s/digitize-number.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math] cover: industrial-tokyo +excerpt: Converts a number to an array of digits, removing its sign if necessary. +listed: true dateModified: 2020-10-18 --- diff --git a/content/snippets/js/s/divmod.md b/content/snippets/js/s/divmod.md index 96ebac5f1f3..f9899c48987 100644 --- a/content/snippets/js/s/divmod.md +++ b/content/snippets/js/s/divmod.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: italian-horizon excerpt: Implement Python's `divmod()` built-in function in one line of JavaScript. +listed: true dateModified: 2023-12-28 --- diff --git a/content/snippets/js/s/double-negation-operator.md b/content/snippets/js/s/double-negation-operator.md index ff2e51928b7..f6305878891 100644 --- a/content/snippets/js/s/double-negation-operator.md +++ b/content/snippets/js/s/double-negation-operator.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: memories-of-pineapple-2 excerpt: You've probably come across the double negation operator (`!!`) before, but do you know what it does? +listed: true dateModified: 2022-07-26 --- diff --git a/content/snippets/js/s/dynamic-getter-chain-proxy.md b/content/snippets/js/s/dynamic-getter-chain-proxy.md index 738dc7552ea..cbfa1b860d4 100644 --- a/content/snippets/js/s/dynamic-getter-chain-proxy.md +++ b/content/snippets/js/s/dynamic-getter-chain-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy] cover: colorful-rocks excerpt: Using the Proxy object, we can create chainable dynamic getters for objects in JavaScript. +listed: true dateModified: 2023-05-28 --- diff --git a/content/snippets/js/s/dynamic-getter-setter-proxy.md b/content/snippets/js/s/dynamic-getter-setter-proxy.md index 46120451770..82b201c54ed 100644 --- a/content/snippets/js/s/dynamic-getter-setter-proxy.md +++ b/content/snippets/js/s/dynamic-getter-setter-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy] cover: green-cabin-cow excerpt: Using the Proxy object, we can create dynamic getters and setters for objects in JavaScript. +listed: true dateModified: 2023-04-09 --- diff --git a/content/snippets/js/s/dynamic-properties-are-slow.md b/content/snippets/js/s/dynamic-properties-are-slow.md index f9d48976355..7f4f617fc78 100644 --- a/content/snippets/js/s/dynamic-properties-are-slow.md +++ b/content/snippets/js/s/dynamic-properties-are-slow.md @@ -6,6 +6,7 @@ language: javascript tags: [object,performance] cover: hiking-balance excerpt: Dynamically adding object properties can be pretty slow in some cases. Here's how to optimize it. +listed: true dateModified: 2022-11-02 --- diff --git a/content/snippets/js/s/edit-url-params.md b/content/snippets/js/s/edit-url-params.md index 7ed9af59fc7..63a045834a5 100644 --- a/content/snippets/js/s/edit-url-params.md +++ b/content/snippets/js/s/edit-url-params.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: sofia-tram excerpt: Avoid the naive approach and use a more robust method to edit URL parameters in JavaScript. +listed: true dateModified: 2022-12-07 --- diff --git a/content/snippets/js/s/element-contains.md b/content/snippets/js/s/element-contains.md index a138e56d8c1..61a86983a61 100644 --- a/content/snippets/js/s/element-contains.md +++ b/content/snippets/js/s/element-contains.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: red-petals +excerpt: Checks if the `parent` element contains the `child` element. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/js/s/element-from-point.md b/content/snippets/js/s/element-from-point.md index 36dc607de71..74a8b4b7cfb 100644 --- a/content/snippets/js/s/element-from-point.md +++ b/content/snippets/js/s/element-from-point.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: armchair-in-yellow excerpt: Using `Document.elementFromPoint()` to easily get the element at a specific point on the page. +listed: true dateModified: 2022-12-18 --- diff --git a/content/snippets/js/s/element-is-visible-in-viewport.md b/content/snippets/js/s/element-is-visible-in-viewport.md index e8c782801c8..547010f9a84 100644 --- a/content/snippets/js/s/element-is-visible-in-viewport.md +++ b/content/snippets/js/s/element-is-visible-in-viewport.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: flower-portrait-1 excerpt: Learn how to check if an element is visible in the browser's viewport, using this simple technique. +listed: true dateModified: 2024-02-11 --- diff --git a/content/snippets/js/s/email-validation.md b/content/snippets/js/s/email-validation.md index 6a454b73f26..1fcc6a3cb75 100644 --- a/content/snippets/js/s/email-validation.md +++ b/content/snippets/js/s/email-validation.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: blank-card excerpt: Email address validation can be much trickier than it sounds. Here's why and my advice on how to approach this problem. +listed: true dateModified: 2022-10-05 --- diff --git a/content/snippets/js/s/empty-array.md b/content/snippets/js/s/empty-array.md index c4e95ca7538..82e6a70ce42 100644 --- a/content/snippets/js/s/empty-array.md +++ b/content/snippets/js/s/empty-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: coconuts excerpt: You can use a lot of different techniques to empty an array in JavaScript. See which ones best suits your needs with this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/encode-decode-strings-with-base64.md b/content/snippets/js/s/encode-decode-strings-with-base64.md index 1980cf4d27f..1db49eebe67 100644 --- a/content/snippets/js/s/encode-decode-strings-with-base64.md +++ b/content/snippets/js/s/encode-decode-strings-with-base64.md @@ -6,6 +6,7 @@ language: javascript tags: [string] excerpt: Encode and decode strings with Base64 in JavaScript easily with these code snippets. cover: thread +listed: true dateModified: 2023-12-25 --- diff --git a/content/snippets/js/s/encodeuri-encodeuricomponent.md b/content/snippets/js/s/encodeuri-encodeuricomponent.md index 9c729b33123..37a98849303 100644 --- a/content/snippets/js/s/encodeuri-encodeuricomponent.md +++ b/content/snippets/js/s/encodeuri-encodeuricomponent.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: laptop-view excerpt: JavaScript provides two methods for encoding characters to URL-safe strings. Do you know when to use each one? +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/enum.md b/content/snippets/js/s/enum.md index 2b9097dc0e6..2dd2780c219 100644 --- a/content/snippets/js/s/enum.md +++ b/content/snippets/js/s/enum.md @@ -6,6 +6,7 @@ language: javascript tags: [object,class,symbol,generator] cover: book-chair excerpt: Enums are part of TypeScript, but what about defining enums in plain old JavaScript? Here are a few way you can do that. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/equality.md b/content/snippets/js/s/equality.md index c410cc19eba..1ae5880ef13 100644 --- a/content/snippets/js/s/equality.md +++ b/content/snippets/js/s/equality.md @@ -6,6 +6,7 @@ language: javascript tags: [type,comparison] cover: beach-pineapple excerpt: Learn all you need to know about the differences between JavaScript's double equals and triple equals operators. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/escape-reg-exp.md b/content/snippets/js/s/escape-reg-exp.md index 34f142c7475..e58c9719fbc 100644 --- a/content/snippets/js/s/escape-reg-exp.md +++ b/content/snippets/js/s/escape-reg-exp.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: frog-blue-flower excerpt: Learn how to escape a string to use in a regular expression. +listed: true dateModified: 2024-05-29 --- diff --git a/content/snippets/js/s/escape-unescape-html.md b/content/snippets/js/s/escape-unescape-html.md index d9493ea6345..de2a23b455f 100644 --- a/content/snippets/js/s/escape-unescape-html.md +++ b/content/snippets/js/s/escape-unescape-html.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: above-the-rocks excerpt: Learn how to convert text into HTML-safe strings and vice versa using JavaScript. +listed: true dateModified: 2024-02-18 --- diff --git a/content/snippets/js/s/eslint-refactor-for-in.md b/content/snippets/js/s/eslint-refactor-for-in.md index b904cf4ae70..979d5eaa158 100644 --- a/content/snippets/js/s/eslint-refactor-for-in.md +++ b/content/snippets/js/s/eslint-refactor-for-in.md @@ -6,6 +6,7 @@ language: javascript tags: [array,iterator,eslint] cover: typing excerpt: ESLint is a really useful tool, but sometimes it gets in the way. Learn how to refactor code to get rid of a common warning. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/euclidean-distance.md b/content/snippets/js/s/euclidean-distance.md index 5515123dba0..2d6393e7b72 100644 --- a/content/snippets/js/s/euclidean-distance.md +++ b/content/snippets/js/s/euclidean-distance.md @@ -5,6 +5,7 @@ language: javascript tags: [math,algorithm] cover: ancient-greek-building excerpt: Use JavaScript's `Math.hypot()` to calculate the Euclidean distance between two points. +listed: true dateModified: 2023-12-18 --- diff --git a/content/snippets/js/s/event-bubbling-capturing-delegation.md b/content/snippets/js/s/event-bubbling-capturing-delegation.md index 5a19c75fdcb..c9833261826 100644 --- a/content/snippets/js/s/event-bubbling-capturing-delegation.md +++ b/content/snippets/js/s/event-bubbling-capturing-delegation.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: fishermen excerpt: Understand how events work in JavaScript and learn when to use event bubbling, event capturing and event delegation with this short guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/event-listener-once.md b/content/snippets/js/s/event-listener-once.md index 768ad663cf2..a8afa93c7e0 100644 --- a/content/snippets/js/s/event-listener-once.md +++ b/content/snippets/js/s/event-listener-once.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: fruit-feast excerpt: Learn how to add an event listener that is executed at most once. +listed: true dateModified: 2023-11-01 --- diff --git a/content/snippets/js/s/event-loop-explained.md b/content/snippets/js/s/event-loop-explained.md index e19ad0600ac..01ebb9dcfa8 100644 --- a/content/snippets/js/s/event-loop-explained.md +++ b/content/snippets/js/s/event-loop-explained.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: tranquility excerpt: The Event Loop is a source of confusion for many developers, but it's a fundamental piece of the JavaScript engine. +listed: true dateModified: 2022-08-21 --- diff --git a/content/snippets/js/s/evil-closures.md b/content/snippets/js/s/evil-closures.md index 5abea06b52d..f1df0dd3e1e 100644 --- a/content/snippets/js/s/evil-closures.md +++ b/content/snippets/js/s/evil-closures.md @@ -6,6 +6,7 @@ language: javascript tags: [function,closure] cover: silver-flat-screen excerpt: Closures are used frequently, yet often misunderstood. Understanding them in depth is crucial to be able to write clean, maintainable code. +listed: true dateModified: 2022-05-18 --- diff --git a/content/snippets/js/s/expand-tabs.md b/content/snippets/js/s/expand-tabs.md index d2df7a1e2da..c208b8acdd1 100644 --- a/content/snippets/js/s/expand-tabs.md +++ b/content/snippets/js/s/expand-tabs.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,regexp] cover: naming-conventions +excerpt: Convert tabs to spaces, where each tab corresponds to `count` spaces. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/js/s/expression-statement.md b/content/snippets/js/s/expression-statement.md index 29c1a543410..895b856a458 100644 --- a/content/snippets/js/s/expression-statement.md +++ b/content/snippets/js/s/expression-statement.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: forest-balcony excerpt: JavaScript distinguishes expressions and statements. Learn their differences in this short article. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/js/s/extend-hex.md b/content/snippets/js/s/extend-hex.md index 1d71a14cf33..a60ba486e04 100644 --- a/content/snippets/js/s/extend-hex.md +++ b/content/snippets/js/s/extend-hex.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: laptop-plants excerpt: Learn how to convert a 3-digit RGB notated hexadecimal color-code to the 6-digit form. +listed: true dateModified: 2024-02-03 --- diff --git a/content/snippets/js/s/factorial.md b/content/snippets/js/s/factorial.md index 33852efb743..f706eee1703 100644 --- a/content/snippets/js/s/factorial.md +++ b/content/snippets/js/s/factorial.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math,algorithm,recursion] cover: flower-vase +excerpt: Calculates the factorial of a number. +listed: true dateModified: 2020-12-28 --- diff --git a/content/snippets/js/s/fast-remove-array-element.md b/content/snippets/js/s/fast-remove-array-element.md index a87155daf1b..0786d19754c 100644 --- a/content/snippets/js/s/fast-remove-array-element.md +++ b/content/snippets/js/s/fast-remove-array-element.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: purple-flower-bunch excerpt: Are you performing a lot of array operations? Maybe element removal is a performance bottleneck you can avoid. +listed: true dateModified: 2022-03-20 --- diff --git a/content/snippets/js/s/fibonacci.md b/content/snippets/js/s/fibonacci.md index 56c1c376a7f..715dd3574ed 100644 --- a/content/snippets/js/s/fibonacci.md +++ b/content/snippets/js/s/fibonacci.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math,algorithm] cover: matrix-flow +excerpt: Generates an array, containing the Fibonacci sequence, up until the nth term. +listed: true dateModified: 2020-12-28 --- diff --git a/content/snippets/js/s/filter-object-keys.md b/content/snippets/js/s/filter-object-keys.md index fdf23a800d1..a0bae7a8c8c 100644 --- a/content/snippets/js/s/filter-object-keys.md +++ b/content/snippets/js/s/filter-object-keys.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: leafy-screens excerpt: Learn how to transform objects by filtering their properties based on an array of keys or a predicate function. +listed: true dateModified: 2024-01-14 --- diff --git a/content/snippets/js/s/find-closest-anchor.md b/content/snippets/js/s/find-closest-anchor.md index 020e38ac757..68daaab0f37 100644 --- a/content/snippets/js/s/find-closest-anchor.md +++ b/content/snippets/js/s/find-closest-anchor.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: clouds-n-mountains +excerpt: Finds the anchor node closest to the given `node`, if any. +listed: true dateModified: 2021-04-22 --- diff --git a/content/snippets/js/s/find-closest-matching-node.md b/content/snippets/js/s/find-closest-matching-node.md index 72a21c9cbd5..04d23315117 100644 --- a/content/snippets/js/s/find-closest-matching-node.md +++ b/content/snippets/js/s/find-closest-matching-node.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: flowering-hills +excerpt: Finds the closest matching node starting at the given `node`. +listed: true dateModified: 2021-04-22 --- diff --git a/content/snippets/js/s/find-matching-keys.md b/content/snippets/js/s/find-matching-keys.md index 7a22d1f13f0..251f03504eb 100644 --- a/content/snippets/js/s/find-matching-keys.md +++ b/content/snippets/js/s/find-matching-keys.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: beach-riders excerpt: Find all the keys in a JavaScript object that match the given value. +listed: true dateModified: 2023-12-15 --- diff --git a/content/snippets/js/s/find-remove-compact-whitespace.md b/content/snippets/js/s/find-remove-compact-whitespace.md index 6ab5c849188..7178cb8ab16 100644 --- a/content/snippets/js/s/find-remove-compact-whitespace.md +++ b/content/snippets/js/s/find-remove-compact-whitespace.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: tropical-bike excerpt: Learn how to work with whitespaces in JavaScript strings, using these simple yet powerful regular expression techniques. +listed: true dateModified: 2024-01-27 --- diff --git a/content/snippets/js/s/first-last-date-of-month.md b/content/snippets/js/s/first-last-date-of-month.md index 0bf7de3ae91..5ab70f2ac06 100644 --- a/content/snippets/js/s/first-last-date-of-month.md +++ b/content/snippets/js/s/first-last-date-of-month.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: polar-bear excerpt: Use the `Date` object and some clever tricks to get the first or last date of a month in JavaScript. +listed: true dateModified: 2024-02-17 --- diff --git a/content/snippets/js/s/first-last-n-elements.md b/content/snippets/js/s/first-last-n-elements.md index ac511266437..f873506a5e8 100644 --- a/content/snippets/js/s/first-last-n-elements.md +++ b/content/snippets/js/s/first-last-n-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: fort-lamp excerpt: Learn how to retrieve the first or last `n` elements in a JavaScript array with a single line of code. +listed: true dateModified: 2023-10-04 --- diff --git a/content/snippets/js/s/flat-iterator.md b/content/snippets/js/s/flat-iterator.md index 9bb8c1a4866..7f8be8d3295 100644 --- a/content/snippets/js/s/flat-iterator.md +++ b/content/snippets/js/s/flat-iterator.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array,iterator,generator] cover: sail-away-2 +excerpt: Creates a generator that iterates over an iterable, flattening nested iterables. +listed: true dateModified: 2022-03-09 --- diff --git a/content/snippets/js/s/flatten-unflatten-object.md b/content/snippets/js/s/flatten-unflatten-object.md index 174b6841c45..9d939f8118d 100644 --- a/content/snippets/js/s/flatten-unflatten-object.md +++ b/content/snippets/js/s/flatten-unflatten-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object,recursion] cover: lighthouse excerpt: Learn how to manipulate JavaScript objects by flattening or unflattening them. +listed: true dateModified: 2024-01-03 --- diff --git a/content/snippets/js/s/flip-function-arguments.md b/content/snippets/js/s/flip-function-arguments.md index 1201f236ec4..01d8ee56933 100644 --- a/content/snippets/js/s/flip-function-arguments.md +++ b/content/snippets/js/s/flip-function-arguments.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: interior-11 +excerpt: Takes a function as an argument, then makes the first argument the last. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/js/s/for-each-right.md b/content/snippets/js/s/for-each-right.md index bdeacccd1cb..486342fdcb9 100644 --- a/content/snippets/js/s/for-each-right.md +++ b/content/snippets/js/s/for-each-right.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: interior-6 excerpt: Learn how to execute a function for each element of an array, starting from the last one. +listed: true dateModified: 2023-10-10 --- diff --git a/content/snippets/js/s/for-in-for-of-foreach.md b/content/snippets/js/s/for-in-for-of-foreach.md index 8a1ad41c883..2e41d877a6d 100644 --- a/content/snippets/js/s/for-in-for-of-foreach.md +++ b/content/snippets/js/s/for-in-for-of-foreach.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object,iterator] cover: lake-loop excerpt: Learn the differences between the three most commonly used iteration methods in JavaScript, that often confuse beginners and veterans alike. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/for-loop-early-break.md b/content/snippets/js/s/for-loop-early-break.md index e457009d151..64eec40ea95 100644 --- a/content/snippets/js/s/for-loop-early-break.md +++ b/content/snippets/js/s/for-loop-early-break.md @@ -6,6 +6,7 @@ language: javascript tags: [array,loop] cover: armchair excerpt: Iteration in JavaScript can be done a handfuld of ways, most often using array methods, but sometimes a `for` loop is the best option. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/form-to-object.md b/content/snippets/js/s/form-to-object.md index e76f7a6a560..941e7c7c399 100644 --- a/content/snippets/js/s/form-to-object.md +++ b/content/snippets/js/s/form-to-object.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,object] cover: down-the-stream excerpt: Convert the data from an HTML form into a JavaScript object or serialize it into a query string. +listed: true dateModified: 2024-01-21 --- diff --git a/content/snippets/js/s/frequency-map-data-structure.md b/content/snippets/js/s/frequency-map-data-structure.md index 56fa7b42926..f10454b3ef4 100644 --- a/content/snippets/js/s/frequency-map-data-structure.md +++ b/content/snippets/js/s/frequency-map-data-structure.md @@ -6,6 +6,7 @@ language: javascript tags: [class] cover: radio-monstera excerpt: A custom data structure to keep track of value frequencies in an array. +listed: true dateModified: 2022-11-13 --- diff --git a/content/snippets/js/s/fullscreen.md b/content/snippets/js/s/fullscreen.md index d92c574875d..e6266bf0d27 100644 --- a/content/snippets/js/s/fullscreen.md +++ b/content/snippets/js/s/fullscreen.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: cloudy-mountaintop-2 excerpt: Did you know you can use JavaScript to toggle fullscreen mode for an element on a webpage? Let's learn how! +listed: true dateModified: 2024-05-23 --- diff --git a/content/snippets/js/s/function-arity.md b/content/snippets/js/s/function-arity.md index bc12dc04802..15b3dd819a1 100644 --- a/content/snippets/js/s/function-arity.md +++ b/content/snippets/js/s/function-arity.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: radio-monstera excerpt: Function arity is a simple, yet useful concept in functional programming, especially when combined with currying. +listed: true dateModified: 2023-12-29 --- diff --git a/content/snippets/js/s/function-based-array-element-grouping.md b/content/snippets/js/s/function-based-array-element-grouping.md index e2b714b8fbd..3c28af9bd76 100644 --- a/content/snippets/js/s/function-based-array-element-grouping.md +++ b/content/snippets/js/s/function-based-array-element-grouping.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array,object] cover: man-cup-laptop +excerpt: Groups the elements of an array based on the given function. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/function-based-array-indexing.md b/content/snippets/js/s/function-based-array-indexing.md index a923791015f..3020ea08c53 100644 --- a/content/snippets/js/s/function-based-array-indexing.md +++ b/content/snippets/js/s/function-based-array-indexing.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array,object] cover: guitar-living-room +excerpt: Creates an object from an array, using a function to map each value to a key. +listed: true dateModified: 2021-06-20 --- diff --git a/content/snippets/js/s/function-call-apply-bind.md b/content/snippets/js/s/function-call-apply-bind.md index 884e1d21c12..4ae1f67aa28 100644 --- a/content/snippets/js/s/function-call-apply-bind.md +++ b/content/snippets/js/s/function-call-apply-bind.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: canoe excerpt: Learn everything you need to know about JavaScript's `call()`, `apply()` and `bind()` in this short guide. +listed: true dateModified: 2024-02-20 --- diff --git a/content/snippets/js/s/function-composition.md b/content/snippets/js/s/function-composition.md index 2009f7a7f18..d293305f0d2 100644 --- a/content/snippets/js/s/function-composition.md +++ b/content/snippets/js/s/function-composition.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: digital-nomad-16 excerpt: Understand the basics of function composition, a fundamental concept in functional programming. +listed: true dateModified: 2023-12-29 --- diff --git a/content/snippets/js/s/functional-programming-introduction.md b/content/snippets/js/s/functional-programming-introduction.md index 6587aa6127c..2460ddb09c5 100644 --- a/content/snippets/js/s/functional-programming-introduction.md +++ b/content/snippets/js/s/functional-programming-introduction.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: driftwood excerpt: A short introduction to the functional programming paradigm. +listed: true dateModified: 2023-12-30 --- diff --git a/content/snippets/js/s/gcd-lcm.md b/content/snippets/js/s/gcd-lcm.md index 33ffb3c88fc..c9e12f56a09 100644 --- a/content/snippets/js/s/gcd-lcm.md +++ b/content/snippets/js/s/gcd-lcm.md @@ -6,6 +6,7 @@ language: javascript tags: [math,algorithm,recursion] cover: migrating-birds excerpt: Use JavaScript to calculate the greatest common divisor and least common multiple of two or more numbers. +listed: true dateModified: 2023-12-19 --- diff --git a/content/snippets/js/s/generate-values-repeatedly.md b/content/snippets/js/s/generate-values-repeatedly.md index 8ae65736e24..dc7833412e1 100644 --- a/content/snippets/js/s/generate-values-repeatedly.md +++ b/content/snippets/js/s/generate-values-repeatedly.md @@ -6,6 +6,7 @@ language: javascript tags: [function,generator] cover: secret-tree excerpt: Learn how to create a generator function that repeats a given value or an array of values indefinitely. +listed: true dateModified: 2024-02-06 --- diff --git a/content/snippets/js/s/generate-while.md b/content/snippets/js/s/generate-while.md index f16b493def9..63185e4c15f 100644 --- a/content/snippets/js/s/generate-while.md +++ b/content/snippets/js/s/generate-while.md @@ -6,6 +6,7 @@ language: javascript tags: [function,generator] cover: yellow-sofa excerpt: Learn how to create a generator function that keeps producing new values as long as the given condition is met. +listed: true dateModified: 2024-01-22 --- diff --git a/content/snippets/js/s/generator-for-range.md b/content/snippets/js/s/generator-for-range.md index aaacc456bf7..69a81a4b081 100644 --- a/content/snippets/js/s/generator-for-range.md +++ b/content/snippets/js/s/generator-for-range.md @@ -6,6 +6,7 @@ language: javascript tags: [function,array] cover: generator excerpt: Learn how to use JavaScript ES6 generators and iterators to iterate over ranges of numbers. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/generator-to-array.md b/content/snippets/js/s/generator-to-array.md index 03c11fa84f3..fc3ec0d5ac9 100644 --- a/content/snippets/js/s/generator-to-array.md +++ b/content/snippets/js/s/generator-to-array.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function,array,generator] cover: messy-papers +excerpt: Converts the output of a generator function to an array. +listed: true dateModified: 2020-12-31 --- diff --git a/content/snippets/js/s/get-ancestors.md b/content/snippets/js/s/get-ancestors.md index 88134a54398..e99c401e398 100644 --- a/content/snippets/js/s/get-ancestors.md +++ b/content/snippets/js/s/get-ancestors.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: interior-8 +excerpt: Returns all the ancestors of an element from the document root to the given element. +listed: true dateModified: 2021-01-05 --- diff --git a/content/snippets/js/s/get-base-url.md b/content/snippets/js/s/get-base-url.md index 3cd83ce352d..59f571792d0 100644 --- a/content/snippets/js/s/get-base-url.md +++ b/content/snippets/js/s/get-base-url.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,browser,regexp] cover: blue-lake +excerpt: Gets the current URL without any parameters or fragment identifiers. +listed: true dateModified: 2021-01-03 --- diff --git a/content/snippets/js/s/get-colon-time-from-date.md b/content/snippets/js/s/get-colon-time-from-date.md index ad90f406fb4..b130b3354e3 100644 --- a/content/snippets/js/s/get-colon-time-from-date.md +++ b/content/snippets/js/s/get-colon-time-from-date.md @@ -6,6 +6,7 @@ language: javascript tags: [date,string] cover: digital-nomad-5 excerpt: Get the time part of a Date object in the format HH:MM:SS. +listed: true dateModified: 2024-05-30 --- diff --git a/content/snippets/js/s/get-elements-bigger-than-viewport.md b/content/snippets/js/s/get-elements-bigger-than-viewport.md index f0515f408b0..4240d9dc5ac 100644 --- a/content/snippets/js/s/get-elements-bigger-than-viewport.md +++ b/content/snippets/js/s/get-elements-bigger-than-viewport.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: case-study +excerpt: Returns an array of HTML elements whose width is larger than that of the viewport's. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/get-images.md b/content/snippets/js/s/get-images.md index 2da3badca46..62b47a6b638 100644 --- a/content/snippets/js/s/get-images.md +++ b/content/snippets/js/s/get-images.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: portal-timelapse excerpt: Use simple DOM queries to find all the images contained within an element. +listed: true dateModified: 2024-05-31 --- diff --git a/content/snippets/js/s/get-nested-object-value.md b/content/snippets/js/s/get-nested-object-value.md index b300022a29d..e22e6c20561 100644 --- a/content/snippets/js/s/get-nested-object-value.md +++ b/content/snippets/js/s/get-nested-object-value.md @@ -6,6 +6,7 @@ language: javascript tags: [object,regexp,recursion] cover: campfire excerpt: Learn how to get a nested object property by key or a path string in JavaScript, and how to search for nested values in an object. +listed: true dateModified: 2024-03-22 --- diff --git a/content/snippets/js/s/get-parents-until.md b/content/snippets/js/s/get-parents-until.md index 12274844aaf..06d6f9d8e18 100644 --- a/content/snippets/js/s/get-parents-until.md +++ b/content/snippets/js/s/get-parents-until.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: orange-coffee-4 +excerpt: Finds all the ancestors of an element up until the element matched by the specified selector. +listed: true dateModified: 2021-01-06 --- diff --git a/content/snippets/js/s/get-scroll-position.md b/content/snippets/js/s/get-scroll-position.md index 2b054887989..a63cab9a896 100644 --- a/content/snippets/js/s/get-scroll-position.md +++ b/content/snippets/js/s/get-scroll-position.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: tranquil-lake excerpt: Calculate the coordinates of the current scroll position in the browser window using JavaScript. +listed: true dateModified: 2024-02-25 --- diff --git a/content/snippets/js/s/get-scrollbar-width.md b/content/snippets/js/s/get-scrollbar-width.md index 03526d6ad56..00fc482f01b 100644 --- a/content/snippets/js/s/get-scrollbar-width.md +++ b/content/snippets/js/s/get-scrollbar-width.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: violin excerpt: Easily and reliably calculate the width of the browser's vertical scrollbar with JavaScript. +listed: true dateModified: 2024-02-24 --- diff --git a/content/snippets/js/s/get-selected-text.md b/content/snippets/js/s/get-selected-text.md index 10f82b520fc..a02cbfa3c2f 100644 --- a/content/snippets/js/s/get-selected-text.md +++ b/content/snippets/js/s/get-selected-text.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: white-tablet-2 +excerpt: Gets the currently selected text. +listed: true dateModified: 2020-10-19 --- diff --git a/content/snippets/js/s/get-set-add-styles-to-html-element.md b/content/snippets/js/s/get-set-add-styles-to-html-element.md index 2d3ed066425..15911cdae36 100644 --- a/content/snippets/js/s/get-set-add-styles-to-html-element.md +++ b/content/snippets/js/s/get-set-add-styles-to-html-element.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,css] cover: frog-blue-flower excerpt: Learn how to retrieve and manipulate the styles of an HTML element easily and efficiently with JavaScript. +listed: true dateModified: 2024-02-21 --- diff --git a/content/snippets/js/s/get-siblings.md b/content/snippets/js/s/get-siblings.md index ccb6880edf0..1bba2856271 100644 --- a/content/snippets/js/s/get-siblings.md +++ b/content/snippets/js/s/get-siblings.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: little-white-flowers +excerpt: Returns an array containing all the siblings of the given element. +listed: true dateModified: 2020-10-19 --- diff --git a/content/snippets/js/s/get-url-parameters.md b/content/snippets/js/s/get-url-parameters.md index fe96df823f8..9b75aa0ea76 100644 --- a/content/snippets/js/s/get-url-parameters.md +++ b/content/snippets/js/s/get-url-parameters.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,string,regexp] cover: metro-tunnel +excerpt: Creates an object containing the parameters of the current URL. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/get-vertical-offset.md b/content/snippets/js/s/get-vertical-offset.md index f6172a893da..fbf518d25c1 100644 --- a/content/snippets/js/s/get-vertical-offset.md +++ b/content/snippets/js/s/get-vertical-offset.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: waves-from-above-2 +excerpt: Finds the distance from a given element to the top of the document. +listed: true dateModified: 2021-01-05 --- diff --git a/content/snippets/js/s/hamming-distance.md b/content/snippets/js/s/hamming-distance.md index 850250d267a..9afe2026e18 100644 --- a/content/snippets/js/s/hamming-distance.md +++ b/content/snippets/js/s/hamming-distance.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math,algorithm] cover: colorful-lounge +excerpt: Calculates the Hamming distance between two values. +listed: true dateModified: 2020-12-28 --- diff --git a/content/snippets/js/s/hash-sha-256.md b/content/snippets/js/s/hash-sha-256.md index ca67cb079ea..d5a5e87fbc9 100644 --- a/content/snippets/js/s/hash-sha-256.md +++ b/content/snippets/js/s/hash-sha-256.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,node,promise] cover: padlocks excerpt: Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js. +listed: true dateModified: 2023-10-07 --- diff --git a/content/snippets/js/s/hash-string-into-number.md b/content/snippets/js/s/hash-string-into-number.md index 1b06f0d0c29..0b4f6135cbb 100644 --- a/content/snippets/js/s/hash-string-into-number.md +++ b/content/snippets/js/s/hash-string-into-number.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: cloudy-lake-reflection excerpt: SDBM is a simple, non-cryptographic hash function that can hash strings into whole numbers. Here's a JavaScript implementation. +listed: true dateModified: 2024-03-03 --- diff --git a/content/snippets/js/s/heapsort.md b/content/snippets/js/s/heapsort.md index 3e5c023edb2..98617ef7edc 100644 --- a/content/snippets/js/s/heapsort.md +++ b/content/snippets/js/s/heapsort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array,recursion] cover: building-blocks excerpt: Sort an array of numbers, using the heapsort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/higher-order-functions.md b/content/snippets/js/s/higher-order-functions.md index 44eccfdadbe..40d1c6e82e4 100644 --- a/content/snippets/js/s/higher-order-functions.md +++ b/content/snippets/js/s/higher-order-functions.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: rock-climbing excerpt: Learn everything you need to know about higher-order functions with this short guide and level up your programming skills. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/js/s/hsl-to-array-or-object.md b/content/snippets/js/s/hsl-to-array-or-object.md index 7e53b5c8e87..bd6ab0e626d 100644 --- a/content/snippets/js/s/hsl-to-array-or-object.md +++ b/content/snippets/js/s/hsl-to-array-or-object.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: number-2 excerpt: Easily convert an `hsl()` color string to an array of values or an object with the values of each color. +listed: true dateModified: 2024-03-07 --- diff --git a/content/snippets/js/s/html-element-test-add-remove-toggle-class.md b/content/snippets/js/s/html-element-test-add-remove-toggle-class.md index a0c80bb6d98..0133b0734a4 100644 --- a/content/snippets/js/s/html-element-test-add-remove-toggle-class.md +++ b/content/snippets/js/s/html-element-test-add-remove-toggle-class.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: bag-waiting excerpt: Learn how to work with HTML element classes in JavaScript, from simple class checks to adding, removing and toggling classes. +listed: true dateModified: 2024-01-21 --- diff --git a/content/snippets/js/s/http-get-post-put-delete.md b/content/snippets/js/s/http-get-post-put-delete.md index 755aa53b751..f7d53a317f8 100644 --- a/content/snippets/js/s/http-get-post-put-delete.md +++ b/content/snippets/js/s/http-get-post-put-delete.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: boat-port excerpt: Learn how to perform HTTP GET, POST, PUT, and DELETE requests in JavaScript. +listed: true dateModified: 2024-02-13 --- diff --git a/content/snippets/js/s/https-redirect.md b/content/snippets/js/s/https-redirect.md index 89e88416c5d..a3f6a88aa89 100644 --- a/content/snippets/js/s/https-redirect.md +++ b/content/snippets/js/s/https-redirect.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: blue-lake excerpt: Learn how to redirect the page to HTTPS if it's currently in HTTP. +listed: true dateModified: 2023-10-18 --- diff --git a/content/snippets/js/s/iife.md b/content/snippets/js/s/iife.md index b6b2d7bb401..7bfc77664e6 100644 --- a/content/snippets/js/s/iife.md +++ b/content/snippets/js/s/iife.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: tropical-waterfall excerpt: An Immediately Invoked Function Expression (IIFE) is a JavaScript trick that trips up many developers. Here's what you need to know. +listed: true dateModified: 2021-06-14 --- diff --git a/content/snippets/js/s/immutability.md b/content/snippets/js/s/immutability.md index 459982709d8..687502ae7cb 100644 --- a/content/snippets/js/s/immutability.md +++ b/content/snippets/js/s/immutability.md @@ -6,6 +6,7 @@ language: javascript tags: [webdev] cover: stars-n-snow excerpt: Immutability is a fundamental concept you should be familiar with when learning functional programming. +listed: true dateModified: 2023-12-14 --- diff --git a/content/snippets/js/s/immutable-object-proxy.md b/content/snippets/js/s/immutable-object-proxy.md index 496ac6d3a13..992b5d65051 100644 --- a/content/snippets/js/s/immutable-object-proxy.md +++ b/content/snippets/js/s/immutable-object-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy] cover: frozen-globe excerpt: Freezing objects is not the only way to prevent mutations. Learn how you can leverage the Proxy object to your advantage. +listed: true dateModified: 2022-04-10 --- diff --git a/content/snippets/js/s/includes-case-insensitive.md b/content/snippets/js/s/includes-case-insensitive.md index 6f2ea2d802f..1e4680182df 100644 --- a/content/snippets/js/s/includes-case-insensitive.md +++ b/content/snippets/js/s/includes-case-insensitive.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: cup-of-orange excerpt: Search for substrings in JavaScript strings without worrying about case sensitivity. +listed: true dateModified: 2024-05-25 --- diff --git a/content/snippets/js/s/indent-string.md b/content/snippets/js/s/indent-string.md index 1d99fccd50b..e0bcf65c7bc 100644 --- a/content/snippets/js/s/indent-string.md +++ b/content/snippets/js/s/indent-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: metropolitan-window excerpt: Indent each line in a string by a specified number of spaces or a custom indentation character. +listed: true dateModified: 2024-05-19 --- diff --git a/content/snippets/js/s/index-for-of-loop.md b/content/snippets/js/s/index-for-of-loop.md index d7a6bb66cc4..56d372d46bb 100644 --- a/content/snippets/js/s/index-for-of-loop.md +++ b/content/snippets/js/s/index-for-of-loop.md @@ -6,6 +6,7 @@ language: javascript tags: [array,iterator] cover: cave-view excerpt: Did you know you can get the index of an array item in a JavaScript for...of loop? Learn how with this bite-sized tip. +listed: true dateModified: 2021-07-25 --- diff --git a/content/snippets/js/s/index-of-substrings.md b/content/snippets/js/s/index-of-substrings.md index 73928b2f565..04227a9c4fa 100644 --- a/content/snippets/js/s/index-of-substrings.md +++ b/content/snippets/js/s/index-of-substrings.md @@ -6,6 +6,7 @@ language: javascript tags: [string,generator] cover: armchair-in-yellow excerpt: Create a generator function that finds all the indexes of a substring in a given string. +listed: true dateModified: 2024-03-10 --- diff --git a/content/snippets/js/s/initialize-2d-array.md b/content/snippets/js/s/initialize-2d-array.md index e42ed915cf9..1942ba9966b 100644 --- a/content/snippets/js/s/initialize-2d-array.md +++ b/content/snippets/js/s/initialize-2d-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,recursion] cover: cloudy-rock-formation excerpt: Learn how to initialize a 2D array in JavaScript in a handful of different ways. +listed: true dateModified: 2023-12-27 --- diff --git a/content/snippets/js/s/initialize-array-with-generated-sequence.md b/content/snippets/js/s/initialize-array-with-generated-sequence.md index fda081c04d0..cd55203f751 100644 --- a/content/snippets/js/s/initialize-array-with-generated-sequence.md +++ b/content/snippets/js/s/initialize-array-with-generated-sequence.md @@ -6,6 +6,7 @@ language: javascript tags: [array, generator] cover: neon-desk-2 excerpt: Ever wanted to initialize an array with a sequence of generated values? Here's a few ways to do it. +listed: true dateModified: 2023-12-27 --- diff --git a/content/snippets/js/s/initialize-array-with-range.md b/content/snippets/js/s/initialize-array-with-range.md index ef9cc347a8d..22f20b376d0 100644 --- a/content/snippets/js/s/initialize-array-with-range.md +++ b/content/snippets/js/s/initialize-array-with-range.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: spanish-resort excerpt: Learn how to create an inclusive array with numbers in a range, using a common `step` difference. +listed: true dateModified: 2023-12-25 --- diff --git a/content/snippets/js/s/initialize-array-with-values.md b/content/snippets/js/s/initialize-array-with-values.md index 204ffe1ba83..5ae49200a1b 100644 --- a/content/snippets/js/s/initialize-array-with-values.md +++ b/content/snippets/js/s/initialize-array-with-values.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: flower-portrait-1 excerpt: Initialize and fill a JavaScript array with the specified values, quickly and easily. +listed: true dateModified: 2023-12-26 --- diff --git a/content/snippets/js/s/inject-css.md b/content/snippets/js/s/inject-css.md index 59e919f2b32..9b03fb16f23 100644 --- a/content/snippets/js/s/inject-css.md +++ b/content/snippets/js/s/inject-css.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,css] cover: dark-leaves-5 excerpt: Injecting CSS into a page via JavaScript is pretty easy, if you know how to leverage the DOM. +listed: true dateModified: 2024-02-09 --- diff --git a/content/snippets/js/s/insert-html-string-before-or-after-element.md b/content/snippets/js/s/insert-html-string-before-or-after-element.md index 289b8cf25f1..39d2e0fa1c2 100644 --- a/content/snippets/js/s/insert-html-string-before-or-after-element.md +++ b/content/snippets/js/s/insert-html-string-before-or-after-element.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: malibu excerpt: Learn how to insert an HTML string before or after the start of a specified element using JavaScript. +listed: true dateModified: 2024-01-29 --- diff --git a/content/snippets/js/s/insertion-index-in-sorted-array.md b/content/snippets/js/s/insertion-index-in-sorted-array.md index 5ca4c69090d..efcc37e673c 100644 --- a/content/snippets/js/s/insertion-index-in-sorted-array.md +++ b/content/snippets/js/s/insertion-index-in-sorted-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,math] cover: apples excerpt: Given a sorted array, find the correct index to insert a given value. +listed: true dateModified: 2024-01-02 --- diff --git a/content/snippets/js/s/insertion-sort.md b/content/snippets/js/s/insertion-sort.md index 9f3e71df322..1b912252003 100644 --- a/content/snippets/js/s/insertion-sort.md +++ b/content/snippets/js/s/insertion-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array] cover: white-tablet-2 excerpt: Sort an array of numbers, using the insertion sort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/invert-key-values.md b/content/snippets/js/s/invert-key-values.md index 134f5d15606..1917dad53e5 100644 --- a/content/snippets/js/s/invert-key-values.md +++ b/content/snippets/js/s/invert-key-values.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: pineapple-on-green excerpt: Learn how to invert the key-value pairs of an object in JavaScript. +listed: true dateModified: 2024-06-09 --- diff --git a/content/snippets/js/s/is-absolute-url.md b/content/snippets/js/s/is-absolute-url.md index ef6443e3397..adf856dc3fa 100644 --- a/content/snippets/js/s/is-absolute-url.md +++ b/content/snippets/js/s/is-absolute-url.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,browser,regexp] cover: coffee-phone-tray-2 +excerpt: Checks if the given string is an absolute URL. +listed: true dateModified: 2020-10-20 --- diff --git a/content/snippets/js/s/is-alpha-numeric.md b/content/snippets/js/s/is-alpha-numeric.md index f1d135e0dba..1c255556ba9 100644 --- a/content/snippets/js/s/is-alpha-numeric.md +++ b/content/snippets/js/s/is-alpha-numeric.md @@ -5,6 +5,7 @@ language: javascript tags: [string,regexp] cover: mountain-lake-cottage-2 excerpt: Use a regular expression to check if a string contains only alpha or alphanumeric characters in JavaScript. +listed: true dateModified: 2024-03-24 --- diff --git a/content/snippets/js/s/is-anagram.md b/content/snippets/js/s/is-anagram.md index 0aa8f349cb9..d79d29edbae 100644 --- a/content/snippets/js/s/is-anagram.md +++ b/content/snippets/js/s/is-anagram.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,regexp] cover: new-york +excerpt: Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters). +listed: true dateModified: 2020-10-20 --- diff --git a/content/snippets/js/s/is-date-valid.md b/content/snippets/js/s/is-date-valid.md index e7b4ee4c025..189d5142b74 100644 --- a/content/snippets/js/s/is-date-valid.md +++ b/content/snippets/js/s/is-date-valid.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [date] cover: cave-explorer +excerpt: Checks if a valid date object can be created from the given values. +listed: true dateModified: 2020-10-20 --- diff --git a/content/snippets/js/s/is-leap-year.md b/content/snippets/js/s/is-leap-year.md index 271ed736122..538b4e4a108 100644 --- a/content/snippets/js/s/is-leap-year.md +++ b/content/snippets/js/s/is-leap-year.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: flowering-hills excerpt: Having a hard time wrapping your head around the math involved in checking for leap years? You might not need to! +listed: true dateModified: 2024-05-26 --- diff --git a/content/snippets/js/s/is-local-storage-session-storage-enabled.md b/content/snippets/js/s/is-local-storage-session-storage-enabled.md index 309e8dc5061..1e9d72963b2 100644 --- a/content/snippets/js/s/is-local-storage-session-storage-enabled.md +++ b/content/snippets/js/s/is-local-storage-session-storage-enabled.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: guitar-living-room excerpt: Check if `localStorage` or `sessionStorage` is enabled in the browser, using a simple JavaScript function. +listed: true dateModified: 2024-01-12 --- diff --git a/content/snippets/js/s/is-node-or-browser.md b/content/snippets/js/s/is-node-or-browser.md index 188269f80c0..2b0a06bbe11 100644 --- a/content/snippets/js/s/is-node-or-browser.md +++ b/content/snippets/js/s/is-node-or-browser.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,node] cover: cloudy-rock-formation excerpt: Determine if the current JavaScript environment is Node.js or a browser. +listed: true dateModified: 2024-01-10 --- diff --git a/content/snippets/js/s/is-prime.md b/content/snippets/js/s/is-prime.md index d0123cec39e..7b24da21158 100644 --- a/content/snippets/js/s/is-prime.md +++ b/content/snippets/js/s/is-prime.md @@ -6,6 +6,7 @@ language: javascript tags: [math,algorithm] cover: thread excerpt: Learn how to check if a number is prime and how to generate prime numbers up to a given number in JavaScript. +listed: true dateModified: 2024-01-25 --- diff --git a/content/snippets/js/s/is-same-origin.md b/content/snippets/js/s/is-same-origin.md index b655722d39b..09a80100fc5 100644 --- a/content/snippets/js/s/is-same-origin.md +++ b/content/snippets/js/s/is-same-origin.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: leafy-screens +excerpt: Checks if two URLs are on the same origin. +listed: true dateModified: 2021-04-22 --- diff --git a/content/snippets/js/s/iso-format-date-with-timezone.md b/content/snippets/js/s/iso-format-date-with-timezone.md index 6481497aa75..d9f41a592d7 100644 --- a/content/snippets/js/s/iso-format-date-with-timezone.md +++ b/content/snippets/js/s/iso-format-date-with-timezone.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: pop-of-green excerpt: Convert a date to extended ISO format (ISO 8601), including timezone offset. +listed: true dateModified: 2024-01-07 --- diff --git a/content/snippets/js/s/iterable-to-array.md b/content/snippets/js/s/iterable-to-array.md index 5826bc17343..4d617804dbb 100644 --- a/content/snippets/js/s/iterable-to-array.md +++ b/content/snippets/js/s/iterable-to-array.md @@ -6,6 +6,7 @@ language: javascript tags: [object,array,string] cover: waves excerpt: Learn how to use the JavaScript ES6 spread syntax to converting iterables to arrays and level up your code today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/iterate-object-properties.md b/content/snippets/js/s/iterate-object-properties.md index 0ae99240bed..e1b4a8d9e4a 100644 --- a/content/snippets/js/s/iterate-object-properties.md +++ b/content/snippets/js/s/iterate-object-properties.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: building-facade excerpt: Iterate over all own properties of an object, running a callback for each one. +listed: true dateModified: 2024-01-16 --- diff --git a/content/snippets/js/s/iterators.md b/content/snippets/js/s/iterators.md index b888660e3d6..dc059af4211 100644 --- a/content/snippets/js/s/iterators.md +++ b/content/snippets/js/s/iterators.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object,iterator] cover: balloons excerpt: Learn how JavaScript's iterators work and how you can use them to level up your projects by understanding these short code examples. +listed: true dateModified: 2021-09-26 --- diff --git a/content/snippets/js/s/jest-mock-global-methods.md b/content/snippets/js/s/jest-mock-global-methods.md index 193607e9241..20e9a889d27 100644 --- a/content/snippets/js/s/jest-mock-global-methods.md +++ b/content/snippets/js/s/jest-mock-global-methods.md @@ -5,6 +5,7 @@ language: javascript tags: [testing] cover: trippy-chemicals excerpt: Testing your code is important, but mocking can be tricky at times. Here's a quick guide on how to mock global object methods in Jest. +listed: true dateModified: 2022-03-27 --- diff --git a/content/snippets/js/s/join-array-into-string.md b/content/snippets/js/s/join-array-into-string.md index 83695df6e90..7bf23170fea 100644 --- a/content/snippets/js/s/join-array-into-string.md +++ b/content/snippets/js/s/join-array-into-string.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: couch-laptop excerpt: Learn how to leverage `Intl.ListFormat` to join an array into a string, with appropriate separators. +listed: true dateModified: 2024-01-23 --- diff --git a/content/snippets/js/s/join-url-segments.md b/content/snippets/js/s/join-url-segments.md index 0749185e2dc..be7ce35d30d 100644 --- a/content/snippets/js/s/join-url-segments.md +++ b/content/snippets/js/s/join-url-segments.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,regexp] cover: digital-nomad-2 +excerpt: Joins all given URL segments together, then normalizes the resulting URL. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/json-stringify-pick-keys.md b/content/snippets/js/s/json-stringify-pick-keys.md index 039fb901740..46f665643db 100644 --- a/content/snippets/js/s/json-stringify-pick-keys.md +++ b/content/snippets/js/s/json-stringify-pick-keys.md @@ -6,6 +6,7 @@ language: javascript tags: [object,json] cover: coffee-drip excerpt: Have you ever wanted to serialize an object but only include certain keys? Turns out JavaScript provides an easy way to do this! +listed: true dateModified: 2021-07-06 --- diff --git a/content/snippets/js/s/json-to-file.md b/content/snippets/js/s/json-to-file.md index a96caca546b..351d3b9256a 100644 --- a/content/snippets/js/s/json-to-file.md +++ b/content/snippets/js/s/json-to-file.md @@ -6,6 +6,7 @@ language: javascript tags: [node, browser] cover: travel-mug-3 excerpt: Learn how to write a JSON object to a file, both using Node.js and in the browser. +listed: true dateModified: 2024-02-01 --- diff --git a/content/snippets/js/s/k-means.md b/content/snippets/js/s/k-means.md index 22d2ed4debc..89e8ef16bd2 100644 --- a/content/snippets/js/s/k-means.md +++ b/content/snippets/js/s/k-means.md @@ -6,6 +6,7 @@ language: javascript tags: [algorithm,array] cover: antelope excerpt: Implement the K-means clustering algorithm in JavaScript to group data into clusters. +listed: true dateModified: 2024-05-11 --- diff --git a/content/snippets/js/s/k-nearest-neighbors.md b/content/snippets/js/s/k-nearest-neighbors.md index 2c2ce6ea682..ea3e9db9723 100644 --- a/content/snippets/js/s/k-nearest-neighbors.md +++ b/content/snippets/js/s/k-nearest-neighbors.md @@ -6,6 +6,7 @@ language: javascript tags: [algorithm,array] cover: building-blocks excerpt: Implement the K-nearest neighbors algorithm in JavaScript to classify a data point relative to a labelled data set. +listed: true dateModified: 2024-05-12 --- diff --git a/content/snippets/js/s/last-element-of-array.md b/content/snippets/js/s/last-element-of-array.md index 49d7ea72a74..dc62be41835 100644 --- a/content/snippets/js/s/last-element-of-array.md +++ b/content/snippets/js/s/last-element-of-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: purple-laptop excerpt: Array destructuring can be leveraged in many different ways. Here's one of them. +listed: true dateModified: 2022-08-28 --- diff --git a/content/snippets/js/s/levenshtein-distance.md b/content/snippets/js/s/levenshtein-distance.md index 0bc87a98caf..a8a4beb2df0 100644 --- a/content/snippets/js/s/levenshtein-distance.md +++ b/content/snippets/js/s/levenshtein-distance.md @@ -6,6 +6,7 @@ language: javascript tags: [string,algorithm] cover: purple-sunset-waves excerpt: Implement the Levenshtein distance algorithm in JavaScript to calculate the difference between two strings. +listed: true dateModified: 2023-12-28 --- diff --git a/content/snippets/js/s/linear-search.md b/content/snippets/js/s/linear-search.md index e86ea84198a..8404912997d 100644 --- a/content/snippets/js/s/linear-search.md +++ b/content/snippets/js/s/linear-search.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [algorithm,array] cover: tranquil-desktop +excerpt: Finds the first index of a given element in an array using the linear search algorithm. +listed: true dateModified: 2020-12-28 --- diff --git a/content/snippets/js/s/listen-click-outside-event.md b/content/snippets/js/s/listen-click-outside-event.md index d4faa3c0c0b..00c7d45ba11 100644 --- a/content/snippets/js/s/listen-click-outside-event.md +++ b/content/snippets/js/s/listen-click-outside-event.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: interior-13 excerpt: Detect and handle click events outside of a specific element in just a few lines of JavaScript. +listed: true dateModified: 2023-11-04 --- diff --git a/content/snippets/js/s/listify.md b/content/snippets/js/s/listify.md index 9d780e1e795..0e2b7c5ae42 100644 --- a/content/snippets/js/s/listify.md +++ b/content/snippets/js/s/listify.md @@ -6,6 +6,7 @@ language: javascript tags: [object,array] cover: metro-arrival excerpt: Map an object to an object array, using the provided mapping function. +listed: true dateModified: 2024-03-22 --- diff --git a/content/snippets/js/s/logical-operations.md b/content/snippets/js/s/logical-operations.md index 983847be790..f83b87c92a6 100644 --- a/content/snippets/js/s/logical-operations.md +++ b/content/snippets/js/s/logical-operations.md @@ -6,6 +6,7 @@ language: javascript tags: [math,logic,function] cover: chess-pawns excerpt: Get started with logical operations in JavaScript with this collection of helper functions. +listed: true dateModified: 2023-05-07 --- diff --git a/content/snippets/js/s/longest-array-element.md b/content/snippets/js/s/longest-array-element.md index aa24ee2efba..1e512df0fc2 100644 --- a/content/snippets/js/s/longest-array-element.md +++ b/content/snippets/js/s/longest-array-element.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array] cover: interior-14 +excerpt: Takes any number of iterable objects or objects with a `length` property and returns the longest one. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/luhn-check.md b/content/snippets/js/s/luhn-check.md index 348900166e2..34edc96ae9e 100644 --- a/content/snippets/js/s/luhn-check.md +++ b/content/snippets/js/s/luhn-check.md @@ -6,6 +6,7 @@ language: javascript tags: [math,algorithm] cover: blank-card excerpt: Implement the Luhn Algorithm, used to validate a variety of identification numbers. +listed: true dateModified: 2024-02-22 --- diff --git a/content/snippets/js/s/make-iterable.md b/content/snippets/js/s/make-iterable.md index 9954de201be..897360d8367 100644 --- a/content/snippets/js/s/make-iterable.md +++ b/content/snippets/js/s/make-iterable.md @@ -6,6 +6,7 @@ language: javascript tags: [array,iterator,generator] cover: rain-shopping excerpt: Did you know you can define an iterator for any JavaScript value? This quick tip will show you how. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/map-array-to-object.md b/content/snippets/js/s/map-array-to-object.md index adc04e24a0a..6507fd261ab 100644 --- a/content/snippets/js/s/map-array-to-object.md +++ b/content/snippets/js/s/map-array-to-object.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: two-lighthouses excerpt: Map the values of an array to an object, using the given mapping functions. +listed: true dateModified: 2024-01-15 --- diff --git a/content/snippets/js/s/map-string.md b/content/snippets/js/s/map-string.md index 23be2c3e7ce..e276f82ca47 100644 --- a/content/snippets/js/s/map-string.md +++ b/content/snippets/js/s/map-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: budapest-palace excerpt: Learn how to replicate the behavior of `Array.prototype.map()` for strings. +listed: true dateModified: 2024-02-27 --- diff --git a/content/snippets/js/s/map-vs-object.md b/content/snippets/js/s/map-vs-object.md index f043e7a5967..ac5f6c3c679 100644 --- a/content/snippets/js/s/map-vs-object.md +++ b/content/snippets/js/s/map-vs-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: tent-stars excerpt: Maps and objects are very similar, but they have some differences that can help you decide which one better fits your use-case. +listed: true dateModified: 2022-02-13 --- diff --git a/content/snippets/js/s/mask-string.md b/content/snippets/js/s/mask-string.md index e91644e5d0d..628a7b0a05d 100644 --- a/content/snippets/js/s/mask-string.md +++ b/content/snippets/js/s/mask-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: rocky-beach-3 excerpt: Replace all characters in a string, except for the ending characters, with a mask character. +listed: true dateModified: 2024-02-12 --- diff --git a/content/snippets/js/s/match-object-properties.md b/content/snippets/js/s/match-object-properties.md index b879a75f7eb..7c07f068e0c 100644 --- a/content/snippets/js/s/match-object-properties.md +++ b/content/snippets/js/s/match-object-properties.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: two-flower-vases excerpt: Compare two objects to determine if the first one contains equivalent property values to the second one. +listed: true dateModified: 2024-03-24 --- diff --git a/content/snippets/js/s/max-subarray.md b/content/snippets/js/s/max-subarray.md index f8efd040b4a..23922be07fe 100644 --- a/content/snippets/js/s/max-subarray.md +++ b/content/snippets/js/s/max-subarray.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [algorithm,math,array] cover: work-hard-computer +excerpt: Finds a contiguous subarray with the largest sum within an array of numbers. +listed: true dateModified: 2022-09-07 --- diff --git a/content/snippets/js/s/memoization.md b/content/snippets/js/s/memoization.md index ef325d7e103..a08b6633209 100644 --- a/content/snippets/js/s/memoization.md +++ b/content/snippets/js/s/memoization.md @@ -6,6 +6,7 @@ language: javascript tags: [function,memoization] cover: cherry-trees excerpt: Learn different ways to memoize function calls in JavaScript as well as when to use memoization to get the best performance results. +listed: true dateModified: 2024-01-26 --- diff --git a/content/snippets/js/s/merge-arrays.md b/content/snippets/js/s/merge-arrays.md index 8a5515a1bfe..0e2d1cd30ba 100644 --- a/content/snippets/js/s/merge-arrays.md +++ b/content/snippets/js/s/merge-arrays.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: arrays excerpt: Arrays are one of the most used data types in any programming language. Learn how to merge two arrays in JavaScript with this short guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/merge-objects.md b/content/snippets/js/s/merge-objects.md index bb896ab84db..0eaa0f976ee 100644 --- a/content/snippets/js/s/merge-objects.md +++ b/content/snippets/js/s/merge-objects.md @@ -6,6 +6,7 @@ language: javascript tags: [object,array,function] cover: guitar-living-room excerpt: Learn how to combine two or more objects into a single object in JavaScript. +listed: true dateModified: 2024-03-20 --- diff --git a/content/snippets/js/s/merge-sort.md b/content/snippets/js/s/merge-sort.md index 9fafdafc418..a754c534b5a 100644 --- a/content/snippets/js/s/merge-sort.md +++ b/content/snippets/js/s/merge-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array,recursion] cover: balloons-field excerpt: Sort an array of numbers, using the merge sort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/midpoint.md b/content/snippets/js/s/midpoint.md index 3f5eadad6e0..b44fe1ba99f 100644 --- a/content/snippets/js/s/midpoint.md +++ b/content/snippets/js/s/midpoint.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: blue-flower excerpt: Calculate the midpoint between two pairs of points in a 2D plane, and beyond. +listed: true dateModified: 2024-05-15 --- diff --git a/content/snippets/js/s/min-max-date.md b/content/snippets/js/s/min-max-date.md index 28908a85dfa..6bfe6da3663 100644 --- a/content/snippets/js/s/min-max-date.md +++ b/content/snippets/js/s/min-max-date.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: interior-2 excerpt: Quickly find the minimum or maximum date in an array of dates. +listed: true dateModified: 2024-01-06 --- diff --git a/content/snippets/js/s/modeling-money-currency-exchange-rates.md b/content/snippets/js/s/modeling-money-currency-exchange-rates.md index df6de316e12..0d3fa653daf 100644 --- a/content/snippets/js/s/modeling-money-currency-exchange-rates.md +++ b/content/snippets/js/s/modeling-money-currency-exchange-rates.md @@ -6,6 +6,7 @@ language: javascript tags: [math,class] cover: money excerpt: A deep dive into modeling money, currencies, and exchange rates using JavaScript. +listed: true dateModified: 2024-04-24 --- diff --git a/content/snippets/js/s/modify-url-without-reload.md b/content/snippets/js/s/modify-url-without-reload.md index 749246513bf..ef372d15271 100644 --- a/content/snippets/js/s/modify-url-without-reload.md +++ b/content/snippets/js/s/modify-url-without-reload.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: compass excerpt: Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page. +listed: true dateModified: 2024-02-10 --- diff --git a/content/snippets/js/s/module-cheatsheet.md b/content/snippets/js/s/module-cheatsheet.md index 40c1f62f447..84102515b92 100644 --- a/content/snippets/js/s/module-cheatsheet.md +++ b/content/snippets/js/s/module-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [cheatsheet] cover: mountain-lake-2 excerpt: Learn everything you need to know about JavaScript modules with this handy cheatsheet. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/most-frequent-array-element.md b/content/snippets/js/s/most-frequent-array-element.md index e071df77acd..45781f57b08 100644 --- a/content/snippets/js/s/most-frequent-array-element.md +++ b/content/snippets/js/s/most-frequent-array-element.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: collab-desk-1 excerpt: Find the most frequently occurring element in a JavaScript array of primitives or objects. +listed: true dateModified: 2024-03-23 --- diff --git a/content/snippets/js/s/naming-conventions.md b/content/snippets/js/s/naming-conventions.md index 28c04ec66d8..e24d97b3f23 100644 --- a/content/snippets/js/s/naming-conventions.md +++ b/content/snippets/js/s/naming-conventions.md @@ -6,6 +6,7 @@ language: javascript tags: [variable,cheatsheet] cover: naming-conventions excerpt: Naming conventions make code easier to read and understand. Learn how to name your variables in JavaScript with this handy guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/native-data-structures.md b/content/snippets/js/s/native-data-structures.md index 4aca09f14b7..3496c2efa2d 100644 --- a/content/snippets/js/s/native-data-structures.md +++ b/content/snippets/js/s/native-data-structures.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: purple-flower-macro-2 excerpt: JavaScript provides a handful of native data structures that you can start using in your code right now. +listed: true dateModified: 2021-09-05 --- diff --git a/content/snippets/js/s/nest-objects.md b/content/snippets/js/s/nest-objects.md index 897ba67c129..b6cfb2241be 100644 --- a/content/snippets/js/s/nest-objects.md +++ b/content/snippets/js/s/nest-objects.md @@ -6,6 +6,7 @@ language: javascript tags: [object,recursion] cover: birds excerpt: Learn how to recursively nest objects linked to one another in a flat array. +listed: true dateModified: 2024-06-06 --- diff --git a/content/snippets/js/s/node-list-to-array.md b/content/snippets/js/s/node-list-to-array.md index 249f3271ffb..4a3ac80e1e3 100644 --- a/content/snippets/js/s/node-list-to-array.md +++ b/content/snippets/js/s/node-list-to-array.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,array] cover: compass-2 excerpt: Ever needed to convert a `NodeList` to an array in JavaScript? Here's the fastest way to do so. +listed: true dateModified: 2024-03-21 --- diff --git a/content/snippets/js/s/nodejs-chrome-debugging.md b/content/snippets/js/s/nodejs-chrome-debugging.md index 4946abc8584..8d98213fa31 100644 --- a/content/snippets/js/s/nodejs-chrome-debugging.md +++ b/content/snippets/js/s/nodejs-chrome-debugging.md @@ -6,6 +6,7 @@ language: javascript tags: [node,debugging] cover: bug excerpt: Did you know you can use Chrome Developer Tools to debug your Node.js code? Find out how in this short guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/nodejs-static-file-server.md b/content/snippets/js/s/nodejs-static-file-server.md index 6a85dea8f96..fcb09af12f0 100644 --- a/content/snippets/js/s/nodejs-static-file-server.md +++ b/content/snippets/js/s/nodejs-static-file-server.md @@ -6,6 +6,7 @@ language: javascript tags: [node,server] cover: man-cup-laptop excerpt: Create your own static file server with Node.js in just 70 lines of code. +listed: true dateModified: 2022-06-05 --- diff --git a/content/snippets/js/s/nodejs-test-module-introduction.md b/content/snippets/js/s/nodejs-test-module-introduction.md index 27432c79001..4d2ae435d99 100644 --- a/content/snippets/js/s/nodejs-test-module-introduction.md +++ b/content/snippets/js/s/nodejs-test-module-introduction.md @@ -6,6 +6,7 @@ language: javascript tags: [node,testing] cover: contemporary-desk excerpt: The Node.js test module is a new testing tool that's still in its early stages. Learn more about it in this short introduction. +listed: true dateModified: 2023-04-30 --- diff --git a/content/snippets/js/s/normalize-line-endings.md b/content/snippets/js/s/normalize-line-endings.md index 808cfdff0d1..43c1e2e02d8 100644 --- a/content/snippets/js/s/normalize-line-endings.md +++ b/content/snippets/js/s/normalize-line-endings.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: red-light excerpt: Having trouble with inconsistent line endings in your strings? Normalize them with this handy JavaScript function! +listed: true dateModified: 2024-05-24 --- diff --git a/content/snippets/js/s/nth-array-element.md b/content/snippets/js/s/nth-array-element.md index 90994716d78..d6361c6dd7b 100644 --- a/content/snippets/js/s/nth-array-element.md +++ b/content/snippets/js/s/nth-array-element.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: dark-leaves-6 excerpt: Find the `nth` or every `nth` element of a JavaScript array. +listed: true dateModified: 2024-01-19 --- diff --git a/content/snippets/js/s/nth-number-root.md b/content/snippets/js/s/nth-number-root.md index 407b0d87ec2..307620dea3a 100644 --- a/content/snippets/js/s/nth-number-root.md +++ b/content/snippets/js/s/nth-number-root.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: tree-roots excerpt: Use `Math.pow()` to calculate the nth root of a given number in JavaScript. +listed: true dateModified: 2024-02-17 --- diff --git a/content/snippets/js/s/nullish-coalescing-optional-chaining.md b/content/snippets/js/s/nullish-coalescing-optional-chaining.md index b2d4ae61072..463700c45e1 100644 --- a/content/snippets/js/s/nullish-coalescing-optional-chaining.md +++ b/content/snippets/js/s/nullish-coalescing-optional-chaining.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: purple-leaves excerpt: JavaScript ES2020 introduced optional chaining and nullish coalescing. Learn everything you need to know with this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/number-formatting.md b/content/snippets/js/s/number-formatting.md index a4df9694b17..38c70226211 100644 --- a/content/snippets/js/s/number-formatting.md +++ b/content/snippets/js/s/number-formatting.md @@ -6,6 +6,7 @@ language: javascript tags: [math,string,date] cover: white-chapel excerpt: Learn common number formatting operations, such as rounding, padding, optional decimal marks, currency, seconds, bytes, and more. +listed: true dateModified: 2024-02-14 --- diff --git a/content/snippets/js/s/number-in-range.md b/content/snippets/js/s/number-in-range.md index c904f0bd1ff..472e9d32894 100644 --- a/content/snippets/js/s/number-in-range.md +++ b/content/snippets/js/s/number-in-range.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math] cover: white-tablet +excerpt: Checks if the given number falls within the given range. +listed: true dateModified: 2020-11-01 --- diff --git a/content/snippets/js/s/number-is-even-odd.md b/content/snippets/js/s/number-is-even-odd.md index 05e296b7e2e..a2c4dcb3c04 100644 --- a/content/snippets/js/s/number-is-even-odd.md +++ b/content/snippets/js/s/number-is-even-odd.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: by-the-lighthouse excerpt: Check if a number is even or odd using JavaScript using the modulo operator or bitwise AND operator. +listed: true dateModified: 2023-10-06 --- diff --git a/content/snippets/js/s/number-validation.md b/content/snippets/js/s/number-validation.md index 0673980f6c9..2a660b1a884 100644 --- a/content/snippets/js/s/number-validation.md +++ b/content/snippets/js/s/number-validation.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: flower-portrait-9 excerpt: Check if a value can be safely converted to a number in JavaScript. +listed: true dateModified: 2024-05-17 --- diff --git a/content/snippets/js/s/numeric-array-math-operations.md b/content/snippets/js/s/numeric-array-math-operations.md index 2267121347d..536f35cfb4c 100644 --- a/content/snippets/js/s/numeric-array-math-operations.md +++ b/content/snippets/js/s/numeric-array-math-operations.md @@ -6,6 +6,7 @@ language: javascript tags: [array,math] cover: red-lake excerpt: Learn how to work with arrays of numbers in JavaScript, performing common math operations such as sum, average, product and more. +listed: true dateModified: 2024-02-11 --- diff --git a/content/snippets/js/s/numeric-separator.md b/content/snippets/js/s/numeric-separator.md index 537bebe0337..4d98b7cf080 100644 --- a/content/snippets/js/s/numeric-separator.md +++ b/content/snippets/js/s/numeric-separator.md @@ -6,6 +6,7 @@ language: javascript tags: [math,type] cover: coffee-drip excerpt: Numeric separators are a somewhat lesser-known JavaScript syntactic sugar that can make working with large constants a lot easier. +listed: true dateModified: 2021-06-27 --- diff --git a/content/snippets/js/s/object-array-proxy.md b/content/snippets/js/s/object-array-proxy.md index 5ff9d63256c..a46bf541f1f 100644 --- a/content/snippets/js/s/object-array-proxy.md +++ b/content/snippets/js/s/object-array-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,array,proxy,iterator,pattern] cover: birds excerpt: Learn how you can leverage the Proxy object to use a JavaScript object the same way as you would use a regular array. +listed: true dateModified: 2021-09-27 --- diff --git a/content/snippets/js/s/object-comparison.md b/content/snippets/js/s/object-comparison.md index 5f5440b53b6..b5db3ed7c2d 100644 --- a/content/snippets/js/s/object-comparison.md +++ b/content/snippets/js/s/object-comparison.md @@ -6,6 +6,7 @@ language: javascript tags: [object,comparison] cover: blue-lake excerpt: Learn how you can compare two objects in JavaScript using various different techniques. +listed: true dateModified: 2021-09-26 --- diff --git a/content/snippets/js/s/object-has-value-or-key.md b/content/snippets/js/s/object-has-value-or-key.md index 48f0c21b0bd..c38ff95fc59 100644 --- a/content/snippets/js/s/object-has-value-or-key.md +++ b/content/snippets/js/s/object-has-value-or-key.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: plant-corner excerpt: When working with objects, you'll often need to check if a value or key exists, and these snippets will show you how to do just that. +listed: true dateModified: 2024-02-10 --- diff --git a/content/snippets/js/s/object-is-triple-equals.md b/content/snippets/js/s/object-is-triple-equals.md index 7297b045407..4f2baed5532 100644 --- a/content/snippets/js/s/object-is-triple-equals.md +++ b/content/snippets/js/s/object-is-triple-equals.md @@ -6,6 +6,7 @@ language: javascript tags: [object,type] cover: rocky-mountains excerpt: "`Object.is()` and the triple equals operator (`===`) can both be used for equality checking in JavaScript, but when should you use each one?" +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/observable-proxy.md b/content/snippets/js/s/observable-proxy.md index 450658a6199..1ee6afe83a0 100644 --- a/content/snippets/js/s/observable-proxy.md +++ b/content/snippets/js/s/observable-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy] cover: city-view excerpt: Use the Proxy object to implement the Observable pattern in JavaScript. +listed: true dateModified: 2024-05-27 --- diff --git a/content/snippets/js/s/observe-mutations.md b/content/snippets/js/s/observe-mutations.md index 11b771d9303..12e6e753356 100644 --- a/content/snippets/js/s/observe-mutations.md +++ b/content/snippets/js/s/observe-mutations.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,event] cover: invention-shack +excerpt: Creates a new `MutationObserver` and runs the provided callback for each mutation on the specified element. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/offset-array-elements.md b/content/snippets/js/s/offset-array-elements.md index 51ff3d29680..2bf8967aa8b 100644 --- a/content/snippets/js/s/offset-array-elements.md +++ b/content/snippets/js/s/offset-array-elements.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array] cover: interior-10 +excerpt: Moves the specified amount of elements to the end of the array. +listed: true dateModified: 2020-10-21 --- diff --git a/content/snippets/js/s/on-scroll-stop.md b/content/snippets/js/s/on-scroll-stop.md index 74d23be5384..2c8320da01f 100644 --- a/content/snippets/js/s/on-scroll-stop.md +++ b/content/snippets/js/s/on-scroll-stop.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: half-trees excerpt: Use some clever JavaScript tricks to listen for and handle scroll stop events in the browser. +listed: true dateModified: 2024-03-02 --- diff --git a/content/snippets/js/s/pad-string.md b/content/snippets/js/s/pad-string.md index 7d7373c1323..e51dd6c87e7 100644 --- a/content/snippets/js/s/pad-string.md +++ b/content/snippets/js/s/pad-string.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string] cover: bridge-over-road +excerpt: Pads a string on both sides with the specified character, if it's shorter than the specified `length`. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/parse-or-serialize-cookie.md b/content/snippets/js/s/parse-or-serialize-cookie.md index 0382fd09fb7..d82b67f2924 100644 --- a/content/snippets/js/s/parse-or-serialize-cookie.md +++ b/content/snippets/js/s/parse-or-serialize-cookie.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,string] cover: purple-sunset-beach excerpt: Learn how to parse or serialize a cookie with JavaScript, quickly and effectively. +listed: true dateModified: 2024-01-12 --- diff --git a/content/snippets/js/s/partial-sum-array.md b/content/snippets/js/s/partial-sum-array.md index 7cbef856208..90bba894d03 100644 --- a/content/snippets/js/s/partial-sum-array.md +++ b/content/snippets/js/s/partial-sum-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,math] cover: people-on-beach excerpt: Create an array of partial sums, using `Array.prototype.reduce()` and `Array.prototype.slice()`. +listed: true dateModified: 2024-03-24 --- diff --git a/content/snippets/js/s/partially-apply-function.md b/content/snippets/js/s/partially-apply-function.md index e4f4caaa739..c8177d436ea 100644 --- a/content/snippets/js/s/partially-apply-function.md +++ b/content/snippets/js/s/partially-apply-function.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: rocky-beach excerpt: Learn how to leverage partial application to improve the reusability of your JavaScript functions. +listed: true dateModified: 2024-01-31 --- diff --git a/content/snippets/js/s/partition-array.md b/content/snippets/js/s/partition-array.md index ba334e2af9d..59501ff3d5b 100644 --- a/content/snippets/js/s/partition-array.md +++ b/content/snippets/js/s/partition-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: camping-trip excerpt: Group array elements into two or more arrays arrays, depending on the provided function's return value. +listed: true dateModified: 2024-01-09 --- diff --git a/content/snippets/js/s/pass-by-reference-or-pass-by-value.md b/content/snippets/js/s/pass-by-reference-or-pass-by-value.md index 7cf10d3186a..4649b36d5db 100644 --- a/content/snippets/js/s/pass-by-reference-or-pass-by-value.md +++ b/content/snippets/js/s/pass-by-reference-or-pass-by-value.md @@ -6,6 +6,7 @@ language: javascript tags: [function,object] cover: balloons-field excerpt: How JavaScript handles passing data is a source of confusion and bugs for many developers, especially when it comes to object types. +listed: true dateModified: 2021-12-05 --- diff --git a/content/snippets/js/s/passive-scroll-listener-performance.md b/content/snippets/js/s/passive-scroll-listener-performance.md index 7aabba26c69..91cb97c2c00 100644 --- a/content/snippets/js/s/passive-scroll-listener-performance.md +++ b/content/snippets/js/s/passive-scroll-listener-performance.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: chill-surfing excerpt: Scroll listeners can easily become a performance bottleneck for your web application. Here's how to fix that. +listed: true dateModified: 2023-03-07 --- diff --git a/content/snippets/js/s/percentile-of-matches.md b/content/snippets/js/s/percentile-of-matches.md index cfe1b2da2e5..fc9ca1e29c3 100644 --- a/content/snippets/js/s/percentile-of-matches.md +++ b/content/snippets/js/s/percentile-of-matches.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math] cover: collab-desk-2 +excerpt: Calculates the percentage of numbers in the given array that are less or equal to the given value. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/pipe-async-functions.md b/content/snippets/js/s/pipe-async-functions.md index d30f8e5de4d..42fc56b3043 100644 --- a/content/snippets/js/s/pipe-async-functions.md +++ b/content/snippets/js/s/pipe-async-functions.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function,promise] cover: new-york-skyline +excerpt: Performs left-to-right function composition for asynchronous functions. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/pluck-values-from-object-array.md b/content/snippets/js/s/pluck-values-from-object-array.md index 05c03337dee..297adfbc6fb 100644 --- a/content/snippets/js/s/pluck-values-from-object-array.md +++ b/content/snippets/js/s/pluck-values-from-object-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array,object] cover: birds excerpt: Learn how to extract values from an array of objects based on a specified key. +listed: true dateModified: 2024-03-22 --- diff --git a/content/snippets/js/s/pluralize-string.md b/content/snippets/js/s/pluralize-string.md index 375cfa062c9..e8b76e97409 100644 --- a/content/snippets/js/s/pluralize-string.md +++ b/content/snippets/js/s/pluralize-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: shell-focus excerpt: Learn how to pluralize a string in JavaScript based on a number. +listed: true dateModified: 2024-06-02 --- diff --git a/content/snippets/js/s/powerset.md b/content/snippets/js/s/powerset.md index 59382289ffd..2c3d4dc608e 100644 --- a/content/snippets/js/s/powerset.md +++ b/content/snippets/js/s/powerset.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: new-plant excerpt: Generate the powerset of a given array of numbers or other primitive values. +listed: true dateModified: 2024-03-11 --- diff --git a/content/snippets/js/s/prefers-color-scheme.md b/content/snippets/js/s/prefers-color-scheme.md index 76427b4a0e5..31aff118416 100644 --- a/content/snippets/js/s/prefers-color-scheme.md +++ b/content/snippets/js/s/prefers-color-scheme.md @@ -5,6 +5,7 @@ language: javascript tags: [browser] cover: dark-mode excerpt: Use a media query to check if the user prefers a light or dark color scheme. +listed: true dateModified: 2023-11-05 --- diff --git a/content/snippets/js/s/prefix-css-property.md b/content/snippets/js/s/prefix-css-property.md index 5c5fd0e34e2..bb99a16150c 100644 --- a/content/snippets/js/s/prefix-css-property.md +++ b/content/snippets/js/s/prefix-css-property.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,css] cover: cancel-typographer excerpt: Not sure if you need to prefix a CSS property in order to use it? Here's a simple way to figure it out! +listed: true dateModified: 2023-10-20 --- diff --git a/content/snippets/js/s/prefix-postfix-operators.md b/content/snippets/js/s/prefix-postfix-operators.md index 80a0d1126e6..83ce91df89f 100644 --- a/content/snippets/js/s/prefix-postfix-operators.md +++ b/content/snippets/js/s/prefix-postfix-operators.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: plant-candle excerpt: While both the prefix and postfix operators increment a value, the resulting value of the expression is very different. +listed: true dateModified: 2021-10-31 --- diff --git a/content/snippets/js/s/pretty-print-json.md b/content/snippets/js/s/pretty-print-json.md index 31b3216f56b..717e8fb55a8 100644 --- a/content/snippets/js/s/pretty-print-json.md +++ b/content/snippets/js/s/pretty-print-json.md @@ -6,6 +6,7 @@ language: javascript tags: [object,json] cover: memories-of-pineapple-3 excerpt: Pretty-printing JSON objects in pretty easy and customizable in JavaScript. Here's the gist of it. +listed: true dateModified: 2022-07-30 --- diff --git a/content/snippets/js/s/pretty-print-number-of-bytes.md b/content/snippets/js/s/pretty-print-number-of-bytes.md index c48f8f42108..cd12fdc05b5 100644 --- a/content/snippets/js/s/pretty-print-number-of-bytes.md +++ b/content/snippets/js/s/pretty-print-number-of-bytes.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [string,math] cover: digital-nomad +excerpt: Converts a number in bytes to a human-readable string. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/prevent-string-being-escaped.md b/content/snippets/js/s/prevent-string-being-escaped.md index 0b82073edee..2a1ad395fdb 100644 --- a/content/snippets/js/s/prevent-string-being-escaped.md +++ b/content/snippets/js/s/prevent-string-being-escaped.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: glass-blowing excerpt: Strings in JavaScript can be escaped in various ways. But how do you prevent a string from being escaped? Here's a handy trick for that. +listed: true dateModified: 2021-06-17 --- diff --git a/content/snippets/js/s/prime-factors.md b/content/snippets/js/s/prime-factors.md index 673ed38596c..44712b0a322 100644 --- a/content/snippets/js/s/prime-factors.md +++ b/content/snippets/js/s/prime-factors.md @@ -6,6 +6,7 @@ language: javascript tags: [math,algorithm] cover: dark-leaves-3 excerpt: Find the prime factors of a number using trial division in JavaScript. +listed: true dateModified: 2024-02-23 --- diff --git a/content/snippets/js/s/primitive-instanceof.md b/content/snippets/js/s/primitive-instanceof.md index 6b2031b5722..0f18ab2ac44 100644 --- a/content/snippets/js/s/primitive-instanceof.md +++ b/content/snippets/js/s/primitive-instanceof.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: wooden-bowl excerpt: JavaScript's `instanceof` operator can't be used with primitive values, but there are a some tricks that you can leverage to your advantage. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/promise-then-catch.md b/content/snippets/js/s/promise-then-catch.md index 0de737c342c..c56fcd8dcbd 100644 --- a/content/snippets/js/s/promise-then-catch.md +++ b/content/snippets/js/s/promise-then-catch.md @@ -5,6 +5,7 @@ language: javascript tags: [function,promise] cover: blue-sunrise excerpt: Messing up the order of chained `then` and `catch` methods in JavaScript promises can cause problems. Here's a short primer on the subject. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/promise-then-finally.md b/content/snippets/js/s/promise-then-finally.md index 7bf166a3fcc..80fc4cbde77 100644 --- a/content/snippets/js/s/promise-then-finally.md +++ b/content/snippets/js/s/promise-then-finally.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] cover: blue-sunrise excerpt: A JavaScript promise's `then` and `finally` methods seem very similar. But there are a few important differences you need to keep in mind. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/promises.md b/content/snippets/js/s/promises.md index e7301f8cf31..274c458e5e3 100644 --- a/content/snippets/js/s/promises.md +++ b/content/snippets/js/s/promises.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] cover: sail-away excerpt: JavaScript's promises represent the eventual completion (or failure) of asynchronous operations and their resulting value. +listed: true dateModified: 2021-10-24 --- diff --git a/content/snippets/js/s/promisify.md b/content/snippets/js/s/promisify.md index 8b164737389..f6210b0a295 100644 --- a/content/snippets/js/s/promisify.md +++ b/content/snippets/js/s/promisify.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function,promise] cover: nature-screen +excerpt: Converts an asynchronous function to return a promise. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/property-enumerability.md b/content/snippets/js/s/property-enumerability.md index 55dd114060d..54070cedf7c 100644 --- a/content/snippets/js/s/property-enumerability.md +++ b/content/snippets/js/s/property-enumerability.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: old-consoles excerpt: Property enumerability dictates how JavaScript object properties behave in different scenarios. +listed: true dateModified: 2022-09-11 --- diff --git a/content/snippets/js/s/proxy-array-negative-index.md b/content/snippets/js/s/proxy-array-negative-index.md index 13bb3ab1fda..a4bf95da012 100644 --- a/content/snippets/js/s/proxy-array-negative-index.md +++ b/content/snippets/js/s/proxy-array-negative-index.md @@ -6,6 +6,7 @@ language: javascript tags: [array,proxy] cover: budapest-palace excerpt: Ever wanted to use negative indices in JavaScript arrays? Here's a simple way to do it using a Proxy. +listed: true dateModified: 2022-10-02 --- diff --git a/content/snippets/js/s/proxy-introduction.md b/content/snippets/js/s/proxy-introduction.md index 059e6204bbc..59e66925f72 100644 --- a/content/snippets/js/s/proxy-introduction.md +++ b/content/snippets/js/s/proxy-introduction.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy,pattern] cover: red-mountain-range excerpt: A quick introduction to the JavaScript Proxy object and where it can be used. +listed: true dateModified: 2023-04-02 --- diff --git a/content/snippets/js/s/pure-functions.md b/content/snippets/js/s/pure-functions.md index 731a7a19642..72447e1f17b 100644 --- a/content/snippets/js/s/pure-functions.md +++ b/content/snippets/js/s/pure-functions.md @@ -6,6 +6,7 @@ language: javascript tags: [function] cover: dark-leaves excerpt: Pure functions are a very important concept to know, especially if you're interested in functional programming. +listed: true dateModified: 2021-12-19 --- diff --git a/content/snippets/js/s/query-selector-shorthand.md b/content/snippets/js/s/query-selector-shorthand.md index 3fa4408e4ad..d32ef7fc73e 100644 --- a/content/snippets/js/s/query-selector-shorthand.md +++ b/content/snippets/js/s/query-selector-shorthand.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: pineapple-at-work excerpt: Ever wanted to create your own jquery-like query selector shorthand? Here's how! +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/query-string-to-object.md b/content/snippets/js/s/query-string-to-object.md index cf2d4f0bc19..683fa175d7a 100644 --- a/content/snippets/js/s/query-string-to-object.md +++ b/content/snippets/js/s/query-string-to-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: standing-stones excerpt: Convert between a query string and its object representation in JavaScript. +listed: true dateModified: 2024-01-20 --- diff --git a/content/snippets/js/s/quick-sort.md b/content/snippets/js/s/quick-sort.md index d57fc933a81..b3baec2c1da 100644 --- a/content/snippets/js/s/quick-sort.md +++ b/content/snippets/js/s/quick-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array,recursion] cover: eagle excerpt: Sort an array of numbers, using the quicksort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/random-alphanumeric.md b/content/snippets/js/s/random-alphanumeric.md index 1ceca7432ef..81776ac8763 100644 --- a/content/snippets/js/s/random-alphanumeric.md +++ b/content/snippets/js/s/random-alphanumeric.md @@ -6,6 +6,7 @@ language: javascript tags: [string,random] cover: gold-typewriter excerpt: Use JavaScript to generate a random alphanumeric string of a specified length. +listed: true dateModified: 2024-03-15 --- diff --git a/content/snippets/js/s/random-boolean.md b/content/snippets/js/s/random-boolean.md index 8e5b9248c15..aaa68cbb4de 100644 --- a/content/snippets/js/s/random-boolean.md +++ b/content/snippets/js/s/random-boolean.md @@ -6,6 +6,7 @@ language: javascript tags: [math,random] cover: malibu excerpt: A quick, one-liner to generate a random boolean value in JavaScript. +listed: true dateModified: 2024-03-14 --- diff --git a/content/snippets/js/s/random-hex-color-code.md b/content/snippets/js/s/random-hex-color-code.md index 2d75d5de178..29c6a17938e 100644 --- a/content/snippets/js/s/random-hex-color-code.md +++ b/content/snippets/js/s/random-hex-color-code.md @@ -6,6 +6,7 @@ language: javascript tags: [math,random] cover: industrial-tokyo excerpt: Learn how to generate a random hexadecimal color code with a few lines of JavaScript. +listed: true dateModified: 2024-02-02 --- diff --git a/content/snippets/js/s/random-integer-array-in-range.md b/content/snippets/js/s/random-integer-array-in-range.md index f9dd658e3f6..8b27c3fd0b1 100644 --- a/content/snippets/js/s/random-integer-array-in-range.md +++ b/content/snippets/js/s/random-integer-array-in-range.md @@ -6,6 +6,7 @@ language: javascript tags: [math,random] cover: digital-nomad-11 excerpt: Combining `Math.random()` and a few simple math operations, you can generate an array of random integers in a specified range. +listed: true dateModified: 2024-03-15 --- diff --git a/content/snippets/js/s/random-number-or-integer-in-range.md b/content/snippets/js/s/random-number-or-integer-in-range.md index 9878ed7dd06..5cbc4e8914a 100644 --- a/content/snippets/js/s/random-number-or-integer-in-range.md +++ b/content/snippets/js/s/random-number-or-integer-in-range.md @@ -6,6 +6,7 @@ language: javascript tags: [math,random] cover: white-laptop excerpt: Enhance JavaScript's `Math.random()` to generate a random number or integer in a specified range. +listed: true dateModified: 2024-03-12 --- diff --git a/content/snippets/js/s/random-value-pure-functions.md b/content/snippets/js/s/random-value-pure-functions.md index dfcdd52e82b..a59c299dc93 100644 --- a/content/snippets/js/s/random-value-pure-functions.md +++ b/content/snippets/js/s/random-value-pure-functions.md @@ -6,6 +6,7 @@ language: javascript tags: [function,random,testing] cover: do-more-computer excerpt: Randomness and pure functions don't seem to go hand in hand. But where there's a will, there's a way. +listed: true dateModified: 2022-06-19 --- diff --git a/content/snippets/js/s/range-generator.md b/content/snippets/js/s/range-generator.md index 133f19bbb1f..dfe194a68bb 100644 --- a/content/snippets/js/s/range-generator.md +++ b/content/snippets/js/s/range-generator.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function,generator] cover: dark-leaves-6 +excerpt: Creates a generator, that generates all values in the given range using the given step. +listed: true dateModified: 2020-10-11 --- diff --git a/content/snippets/js/s/read-file-lines.md b/content/snippets/js/s/read-file-lines.md index fdee4a17c8b..7137a446eaa 100644 --- a/content/snippets/js/s/read-file-lines.md +++ b/content/snippets/js/s/read-file-lines.md @@ -6,6 +6,7 @@ language: javascript tags: [node] cover: solitude-beach excerpt: Parse a text file and return an array of lines, synchronously or asynchronously, using Node.js. +listed: true dateModified: 2024-05-20 --- diff --git a/content/snippets/js/s/rearrange-function-arguments.md b/content/snippets/js/s/rearrange-function-arguments.md index 7f37593bb76..74713b1aad4 100644 --- a/content/snippets/js/s/rearrange-function-arguments.md +++ b/content/snippets/js/s/rearrange-function-arguments.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: island-corridor +excerpt: Creates a function that invokes the provided function with its arguments arranged according to the specified indexes. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/record-animation-frames.md b/content/snippets/js/s/record-animation-frames.md index f483aa27fa3..8393a306241 100644 --- a/content/snippets/js/s/record-animation-frames.md +++ b/content/snippets/js/s/record-animation-frames.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,recursion] cover: mac-and-coffee +excerpt: Invokes the provided callback on each animation frame. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/recursion.md b/content/snippets/js/s/recursion.md index e66d244c820..20f94c0a565 100644 --- a/content/snippets/js/s/recursion.md +++ b/content/snippets/js/s/recursion.md @@ -6,6 +6,7 @@ language: javascript tags: [function,recursion] cover: curve excerpt: Recursion is a very important programming concept all developers should be familiar with. +listed: true dateModified: 2022-01-23 --- diff --git a/content/snippets/js/s/redirect-to-url.md b/content/snippets/js/s/redirect-to-url.md index aeed02cfc10..93c9503ec1e 100644 --- a/content/snippets/js/s/redirect-to-url.md +++ b/content/snippets/js/s/redirect-to-url.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: coffee-phone-tray-2 +excerpt: Redirects to a specified URL. +listed: true dateModified: 2020-10-20 --- diff --git a/content/snippets/js/s/regexp-cheatsheet.md b/content/snippets/js/s/regexp-cheatsheet.md index ce787f9c6c2..1950fdbdd23 100644 --- a/content/snippets/js/s/regexp-cheatsheet.md +++ b/content/snippets/js/s/regexp-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [string,regexp,cheatsheet] cover: tools excerpt: Regular expressions are a very useful tool. Save this cheatsheet for when you need to look up their syntax and speed up your development. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/reload-module.md b/content/snippets/js/s/reload-module.md index 17b7aa75d2c..1bf73e39a0b 100644 --- a/content/snippets/js/s/reload-module.md +++ b/content/snippets/js/s/reload-module.md @@ -6,6 +6,7 @@ language: javascript tags: [node] cover: tea-laptop-table excerpt: Ever wanted to reload a module in Node.js? Here's how you can do it. +listed: true dateModified: 2024-05-13 --- diff --git a/content/snippets/js/s/reload-page.md b/content/snippets/js/s/reload-page.md index 7fafe266768..92d1be6e7a8 100644 --- a/content/snippets/js/s/reload-page.md +++ b/content/snippets/js/s/reload-page.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: night-tram excerpt: Need to reload the current page using JavaScript? Here's the best way to do it, as well as some alternatives. +listed: true dateModified: 2023-05-14 --- diff --git a/content/snippets/js/s/remove-accents.md b/content/snippets/js/s/remove-accents.md index f0aa6931526..a62ae504420 100644 --- a/content/snippets/js/s/remove-accents.md +++ b/content/snippets/js/s/remove-accents.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: pink-flowers excerpt: Learn how to remove accents from a string in JavaScript, quickly and efficiently. +listed: true dateModified: 2024-02-07 --- diff --git a/content/snippets/js/s/remove-attributes.md b/content/snippets/js/s/remove-attributes.md index 7cadcff2b3b..0532272941e 100644 --- a/content/snippets/js/s/remove-attributes.md +++ b/content/snippets/js/s/remove-attributes.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: new-york excerpt: A simple trick to remove one or more attributes from an HTML element. +listed: true dateModified: 2023-10-21 --- diff --git a/content/snippets/js/s/remove-dom-element.md b/content/snippets/js/s/remove-dom-element.md index 0afb9b89dbd..203d51ab0c6 100644 --- a/content/snippets/js/s/remove-dom-element.md +++ b/content/snippets/js/s/remove-dom-element.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: by-the-lighthouse +excerpt: Removes an element from the DOM. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/js/s/remove-element-from-array.md b/content/snippets/js/s/remove-element-from-array.md index b11bbda8b7c..bdba62cb045 100644 --- a/content/snippets/js/s/remove-element-from-array.md +++ b/content/snippets/js/s/remove-element-from-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: maple-leaf-palette excerpt: Did you know there are multiple ways to remove an element from an array? Let's take a look. +listed: true dateModified: 2022-06-26 --- diff --git a/content/snippets/js/s/remove-elements-from-array.md b/content/snippets/js/s/remove-elements-from-array.md index 2e8413dcbd4..72d86d1a74a 100644 --- a/content/snippets/js/s/remove-elements-from-array.md +++ b/content/snippets/js/s/remove-elements-from-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: chill-surfing excerpt: Did you know that implementing a non-mutating version of `Array.prototype.splice()` is only a few lines of code? +listed: true dateModified: 2023-10-24 --- diff --git a/content/snippets/js/s/remove-first-last-n-array-elements.md b/content/snippets/js/s/remove-first-last-n-array-elements.md index ba0154b0b8e..bfc500b816d 100644 --- a/content/snippets/js/s/remove-first-last-n-array-elements.md +++ b/content/snippets/js/s/remove-first-last-n-array-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: metropolitan-window excerpt: Master JavaScript array element removal with these simple techniques. +listed: true dateModified: 2023-12-24 --- diff --git a/content/snippets/js/s/remove-matching-array-elements.md b/content/snippets/js/s/remove-matching-array-elements.md index a258920a21b..6f9709caa58 100644 --- a/content/snippets/js/s/remove-matching-array-elements.md +++ b/content/snippets/js/s/remove-matching-array-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: highlands excerpt: Given a predicate function, remove elements from an array that match the given condition. +listed: true dateModified: 2024-03-23 --- diff --git a/content/snippets/js/s/remove-multiple-event-listeners.md b/content/snippets/js/s/remove-multiple-event-listeners.md index b2e08a8c3c2..ffa4c1cf884 100644 --- a/content/snippets/js/s/remove-multiple-event-listeners.md +++ b/content/snippets/js/s/remove-multiple-event-listeners.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,event] cover: snowy-mountains +excerpt: Detaches an event listener from all the provided targets. +listed: true dateModified: 2021-04-22 --- diff --git a/content/snippets/js/s/remove-non-ascii.md b/content/snippets/js/s/remove-non-ascii.md index fe768ad022c..3234bb678b0 100644 --- a/content/snippets/js/s/remove-non-ascii.md +++ b/content/snippets/js/s/remove-non-ascii.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: blue-red-mountain excerpt: Remove non-printable ASCII characters from a string in JavaScript. +listed: true dateModified: 2024-05-18 --- diff --git a/content/snippets/js/s/remove-object-property.md b/content/snippets/js/s/remove-object-property.md index d5a96166955..d6fcb11f84a 100644 --- a/content/snippets/js/s/remove-object-property.md +++ b/content/snippets/js/s/remove-object-property.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: brown-bird excerpt: Ever wanted to delete a property from a JavaScript object? Here are a few way you can accomplish that. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/remove-trailing-zeros.md b/content/snippets/js/s/remove-trailing-zeros.md index 82b1deb4f94..358687c82ca 100644 --- a/content/snippets/js/s/remove-trailing-zeros.md +++ b/content/snippets/js/s/remove-trailing-zeros.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: island-corridor excerpt: When formatting decimal values in JavaScript, trailing zeros can be undesired. Here's how to deal with them. +listed: true dateModified: 2024-02-01 --- diff --git a/content/snippets/js/s/render-dom-element.md b/content/snippets/js/s/render-dom-element.md index ba0f57e1cf7..3cacb5666bf 100644 --- a/content/snippets/js/s/render-dom-element.md +++ b/content/snippets/js/s/render-dom-element.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser,recursion] cover: standing-stones +excerpt: Renders the given DOM tree in the specified DOM element. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/js/s/replace-all-occurences-of-string.md b/content/snippets/js/s/replace-all-occurences-of-string.md index 79bcafdcb82..b449d9a07d7 100644 --- a/content/snippets/js/s/replace-all-occurences-of-string.md +++ b/content/snippets/js/s/replace-all-occurences-of-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: blue-computer excerpt: If you need to replace all occurrences of a string in JavaScript, you have a couple of options. +listed: true dateModified: 2022-07-03 --- diff --git a/content/snippets/js/s/replace-last-occurrence.md b/content/snippets/js/s/replace-last-occurrence.md index 1602a1c4652..bd882d8e725 100644 --- a/content/snippets/js/s/replace-last-occurrence.md +++ b/content/snippets/js/s/replace-last-occurrence.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: waves excerpt: Learn how to use regular expressions to replace the last occurrence of a pattern in a JavaScript string. +listed: true dateModified: 2024-02-08 --- diff --git a/content/snippets/js/s/replace-or-append-array-value.md b/content/snippets/js/s/replace-or-append-array-value.md index 790e87c9cbd..9a1d937c57b 100644 --- a/content/snippets/js/s/replace-or-append-array-value.md +++ b/content/snippets/js/s/replace-or-append-array-value.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: boutique-home-office-2 excerpt: Quickly and easily replace or append a value in a JavaScript array. +listed: true dateModified: 2024-03-23 --- diff --git a/content/snippets/js/s/resolve-promise-after-amount-of-time.md b/content/snippets/js/s/resolve-promise-after-amount-of-time.md index e099fffc534..f2b620138dd 100644 --- a/content/snippets/js/s/resolve-promise-after-amount-of-time.md +++ b/content/snippets/js/s/resolve-promise-after-amount-of-time.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] cover: filter-coffee-pot excerpt: Learn how to create a promise that resolves after a given amount of time in JavaScript. +listed: true dateModified: 2024-02-28 --- diff --git a/content/snippets/js/s/return-constructor.md b/content/snippets/js/s/return-constructor.md index 7d108fe319f..a0e8007635b 100644 --- a/content/snippets/js/s/return-constructor.md +++ b/content/snippets/js/s/return-constructor.md @@ -6,6 +6,7 @@ language: javascript tags: [function,class,object] cover: architectural excerpt: The constructor is a crucial part of any JavaScript class, which is why you might want to take a closer look at what they return. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/rgb-hex-hsl-hsb-color-format-conversion.md b/content/snippets/js/s/rgb-hex-hsl-hsb-color-format-conversion.md index 48272399473..67b54d834ea 100644 --- a/content/snippets/js/s/rgb-hex-hsl-hsb-color-format-conversion.md +++ b/content/snippets/js/s/rgb-hex-hsl-hsb-color-format-conversion.md @@ -6,6 +6,7 @@ language: javascript tags: [math,string] cover: lemon-tea excerpt: Learn how to easily convert between the various color formats, using JavaScript and a few simple formulas. +listed: true dateModified: 2024-03-05 --- diff --git a/content/snippets/js/s/rgb-to-array-or-object.md b/content/snippets/js/s/rgb-to-array-or-object.md index 44f757e46f8..ab558549275 100644 --- a/content/snippets/js/s/rgb-to-array-or-object.md +++ b/content/snippets/js/s/rgb-to-array-or-object.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: greek-coffee excerpt: Easily convert an `rgb()` color string to an array of values or an object with the values of each color. +listed: true dateModified: 2024-03-06 --- diff --git a/content/snippets/js/s/run-promises-in-series.md b/content/snippets/js/s/run-promises-in-series.md index 8c78bcd18ee..7b72bc46750 100644 --- a/content/snippets/js/s/run-promises-in-series.md +++ b/content/snippets/js/s/run-promises-in-series.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] cover: sail-away excerpt: Learn how to resolve promises one after another (sequentially) in JavaScript. +listed: true dateModified: 2023-10-15 --- diff --git a/content/snippets/js/s/scroll-to-top.md b/content/snippets/js/s/scroll-to-top.md index 5061185d3ea..602b708e46b 100644 --- a/content/snippets/js/s/scroll-to-top.md +++ b/content/snippets/js/s/scroll-to-top.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [browser] cover: tranquil-lake +excerpt: Smooth-scrolls to the top of the page. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/select-focused-dom-element.md b/content/snippets/js/s/select-focused-dom-element.md index 56a0dd90a53..ca6d34d846f 100644 --- a/content/snippets/js/s/select-focused-dom-element.md +++ b/content/snippets/js/s/select-focused-dom-element.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: horse-sunset excerpt: Here's a quick and easy way to select the currently focused DOM element in JavaScript. +listed: true dateModified: 2022-10-23 --- diff --git a/content/snippets/js/s/selection-sort.md b/content/snippets/js/s/selection-sort.md index 926863e8a9a..804484fde8e 100644 --- a/content/snippets/js/s/selection-sort.md +++ b/content/snippets/js/s/selection-sort.md @@ -5,6 +5,7 @@ language: javascript tags: [algorithm,array] cover: yellow-sofa excerpt: Sort an array of numbers, using the selection sort algorithm. +listed: true dateModified: 2023-12-16 --- diff --git a/content/snippets/js/s/semantic-versioning.md b/content/snippets/js/s/semantic-versioning.md index 292b9c9626f..9fffee8fdc8 100644 --- a/content/snippets/js/s/semantic-versioning.md +++ b/content/snippets/js/s/semantic-versioning.md @@ -6,6 +6,7 @@ language: javascript tags: [node] cover: wet-lowland-golden-hour excerpt: Learn how semantic versioning works and how to use it to correctly version your software. +listed: true dateModified: 2023-07-16 --- diff --git a/content/snippets/js/s/shallow-deep-clone-object.md b/content/snippets/js/s/shallow-deep-clone-object.md index c38c7a22784..cbef9348fcb 100644 --- a/content/snippets/js/s/shallow-deep-clone-object.md +++ b/content/snippets/js/s/shallow-deep-clone-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object,recursion] cover: pagodas excerpt: Learn how JavaScript handles mutable data, such as objects and arrays, and understand how shallow cloning and deep cloning work. +listed: true dateModified: 2024-01-04 --- diff --git a/content/snippets/js/s/show-hide-html-elements.md b/content/snippets/js/s/show-hide-html-elements.md index e579c42d7da..930ad2c86b8 100644 --- a/content/snippets/js/s/show-hide-html-elements.md +++ b/content/snippets/js/s/show-hide-html-elements.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,css] cover: picking-berries excerpt: Ever wanted to show or hide one or more elements in HTML, using JavaScript? Turns out it's very easy to do so. +listed: true dateModified: 2023-10-22 --- diff --git a/content/snippets/js/s/singleton-proxy.md b/content/snippets/js/s/singleton-proxy.md index 4f2ba045098..391c5d1edd9 100644 --- a/content/snippets/js/s/singleton-proxy.md +++ b/content/snippets/js/s/singleton-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,proxy,pattern] cover: obelisk excerpt: Learn how to implement the singleton design pattern in JavaScript, using the Proxy object. +listed: true dateModified: 2021-09-28 --- diff --git a/content/snippets/js/s/sleep.md b/content/snippets/js/s/sleep.md index 57d066df617..8be97522f53 100644 --- a/content/snippets/js/s/sleep.md +++ b/content/snippets/js/s/sleep.md @@ -6,6 +6,7 @@ language: javascript tags: [date,promise] cover: sleepy-cat excerpt: Learn how you can implement a delay function using `setTimeout()`, promises and `async`/`await`. +listed: true dateModified: 2024-01-05 --- diff --git a/content/snippets/js/s/sort-array-of-objects.md b/content/snippets/js/s/sort-array-of-objects.md index aaac84bf852..66fdb22edba 100644 --- a/content/snippets/js/s/sort-array-of-objects.md +++ b/content/snippets/js/s/sort-array-of-objects.md @@ -6,6 +6,7 @@ language: javascript tags: [object,array] cover: volcano-sunset excerpt: Ever wanted to sort an array of objects, but felt like it was too complex? Here's a robust solution for just that. +listed: true dateModified: 2024-01-15 --- diff --git a/content/snippets/js/s/specify-base-for-math-log.md b/content/snippets/js/s/specify-base-for-math-log.md index 5febda98963..c26a1836667 100644 --- a/content/snippets/js/s/specify-base-for-math-log.md +++ b/content/snippets/js/s/specify-base-for-math-log.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: yellow-white-mug-2 excerpt: Calculate the logarithm of a number or check if a number is a power of a specific base. +listed: true dateModified: 2024-01-03 --- diff --git a/content/snippets/js/s/split-array-into-chunks.md b/content/snippets/js/s/split-array-into-chunks.md index dd98e7a1813..54afe764a5d 100644 --- a/content/snippets/js/s/split-array-into-chunks.md +++ b/content/snippets/js/s/split-array-into-chunks.md @@ -6,6 +6,7 @@ language: javascript tags: [array,function,generator] cover: filter-coffee-pot excerpt: Chunk an array or iterable into arrays of a specified size or a given number of chunks. +listed: true dateModified: 2023-11-07 --- diff --git a/content/snippets/js/s/spread-operator-tricks.md b/content/snippets/js/s/spread-operator-tricks.md index e6d40d43117..d581a248d52 100644 --- a/content/snippets/js/s/spread-operator-tricks.md +++ b/content/snippets/js/s/spread-operator-tricks.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: succulent-crowd excerpt: JavaScript’s spread operator is a very versatile tool. Here are some simple ways to use it. +listed: true dateModified: 2022-04-17 --- diff --git a/content/snippets/js/s/spread-rest-syntax.md b/content/snippets/js/s/spread-rest-syntax.md index 9774053d9b7..43acb06ae94 100644 --- a/content/snippets/js/s/spread-rest-syntax.md +++ b/content/snippets/js/s/spread-rest-syntax.md @@ -6,6 +6,7 @@ language: javascript tags: [array,function] cover: antelope excerpt: JavaScript ES6 introduced us to powerful new features, such as the spread and rest syntax. Learn all you need to know in this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/static-instance-methods.md b/content/snippets/js/s/static-instance-methods.md index f0fa440d3d2..85c23c7fb85 100644 --- a/content/snippets/js/s/static-instance-methods.md +++ b/content/snippets/js/s/static-instance-methods.md @@ -6,6 +6,7 @@ language: javascript tags: [object,function,class] cover: lake-runner excerpt: Static and instance methods are pretty easy to distinguish and serve different purposes. Learn all about them in this article. +listed: true dateModified: 2022-01-30 --- diff --git a/content/snippets/js/s/store-dom-items.md b/content/snippets/js/s/store-dom-items.md index 024f2f16303..fb8a746ded9 100644 --- a/content/snippets/js/s/store-dom-items.md +++ b/content/snippets/js/s/store-dom-items.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: armchair excerpt: Increase your JavaScript code's performance when working with the DOM by leveraging this simple trick. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/string-case-conversion.md b/content/snippets/js/s/string-case-conversion.md index 2bd833ba603..beb97889584 100644 --- a/content/snippets/js/s/string-case-conversion.md +++ b/content/snippets/js/s/string-case-conversion.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: chubby-squirrel excerpt: A complete guide to case conversion in JavaScript, including camel case, kebab case, snake case, Pascal case, title case and sentence case. +listed: true dateModified: 2023-12-31 --- diff --git a/content/snippets/js/s/string-contains-substring.md b/content/snippets/js/s/string-contains-substring.md index 66cd7a1179f..52b6f5b0fa4 100644 --- a/content/snippets/js/s/string-contains-substring.md +++ b/content/snippets/js/s/string-contains-substring.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: cave-explorer excerpt: Let's have a look at how to check if a string contains a substring in JavaScript. +listed: true dateModified: 2022-07-27 --- diff --git a/content/snippets/js/s/string-immutability.md b/content/snippets/js/s/string-immutability.md index fa764b1853b..0b468357bd7 100644 --- a/content/snippets/js/s/string-immutability.md +++ b/content/snippets/js/s/string-immutability.md @@ -6,6 +6,7 @@ language: javascript tags: [string,type] cover: purple-sunset excerpt: When it comes to immutability, JavaScript strings are often a source of confusion. Yet they're not as complicated as you might expect. +listed: true dateModified: 2021-10-10 --- diff --git a/content/snippets/js/s/string-is-uppercase-or-lowercase.md b/content/snippets/js/s/string-is-uppercase-or-lowercase.md index 4fb0adb9b92..1ec0e7e895e 100644 --- a/content/snippets/js/s/string-is-uppercase-or-lowercase.md +++ b/content/snippets/js/s/string-is-uppercase-or-lowercase.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: flower-portrait-7 excerpt: Use these simple tricks to check if a string is uppercase or lowercase in JavaScript. +listed: true dateModified: 2023-12-20 --- diff --git a/content/snippets/js/s/string-is-valid-json.md b/content/snippets/js/s/string-is-valid-json.md index 8f4335fee79..46d0bf21542 100644 --- a/content/snippets/js/s/string-is-valid-json.md +++ b/content/snippets/js/s/string-is-valid-json.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: italian-horizon excerpt: Use a simple JavaScript trick to validate a serialized JSON object. +listed: true dateModified: 2024-03-17 --- diff --git a/content/snippets/js/s/string-starts-or-ends-with-substring.md b/content/snippets/js/s/string-starts-or-ends-with-substring.md index cf6050f6e7b..498498e46a7 100644 --- a/content/snippets/js/s/string-starts-or-ends-with-substring.md +++ b/content/snippets/js/s/string-starts-or-ends-with-substring.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: boutique-home-office-4 excerpt: Test if a string's start or end partially matches another string. +listed: true dateModified: 2023-12-31 --- diff --git a/content/snippets/js/s/string-to-boolean.md b/content/snippets/js/s/string-to-boolean.md index 4e7073094e9..1e4d9e5399e 100644 --- a/content/snippets/js/s/string-to-boolean.md +++ b/content/snippets/js/s/string-to-boolean.md @@ -6,6 +6,7 @@ language: javascript tags: [string,boolean,type] cover: two-cities excerpt: Have you ever tried to convert the string representation of a boolean to an actual boolean value? Here's a simple way to do it. +listed: true dateModified: 2022-09-14 --- diff --git a/content/snippets/js/s/string-to-slug.md b/content/snippets/js/s/string-to-slug.md index 09270c1d812..9a5ddc774da 100644 --- a/content/snippets/js/s/string-to-slug.md +++ b/content/snippets/js/s/string-to-slug.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: collab-desk-2 excerpt: Learn how to easily convert any string to a URL-friendly slug, using regular expressions. +listed: true dateModified: 2024-02-05 --- diff --git a/content/snippets/js/s/string-to-words.md b/content/snippets/js/s/string-to-words.md index 819503109f9..08db7f6a4d3 100644 --- a/content/snippets/js/s/string-to-words.md +++ b/content/snippets/js/s/string-to-words.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: sea-view-2 excerpt: Learn how to split a string into words, using the `Intl.Segmenter` API. +listed: true dateModified: 2024-01-24 --- diff --git a/content/snippets/js/s/stringify-circular-json.md b/content/snippets/js/s/stringify-circular-json.md index 475c371fa34..171836a728a 100644 --- a/content/snippets/js/s/stringify-circular-json.md +++ b/content/snippets/js/s/stringify-circular-json.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: waving-over-lake excerpt: Circular JSON objects can't be serialized using `JSON.stringify()`, but you can use this trick to handle them. +listed: true dateModified: 2024-03-18 --- diff --git a/content/snippets/js/s/strip-html-tags.md b/content/snippets/js/s/strip-html-tags.md index b3191ae48b0..0710a5f9ff8 100644 --- a/content/snippets/js/s/strip-html-tags.md +++ b/content/snippets/js/s/strip-html-tags.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: coffee-phone-tray-3 excerpt: Use a regular expression to remove HTML/XML tags from a string. +listed: true dateModified: 2024-03-15 --- diff --git a/content/snippets/js/s/substring-generator.md b/content/snippets/js/s/substring-generator.md index fe6a9730e97..18e62f8521b 100644 --- a/content/snippets/js/s/substring-generator.md +++ b/content/snippets/js/s/substring-generator.md @@ -6,6 +6,7 @@ language: javascript tags: [string,generator] cover: boutique-home-office-1 excerpt: Get all the partial substrings of a string in JavaScript using generator functions. +listed: true dateModified: 2023-10-25 --- diff --git a/content/snippets/js/s/sum-powers-in-range.md b/content/snippets/js/s/sum-powers-in-range.md index faa6dd46789..dcf0bd19554 100644 --- a/content/snippets/js/s/sum-powers-in-range.md +++ b/content/snippets/js/s/sum-powers-in-range.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [math] cover: boat-port +excerpt: Calculates the sum of the powers of all the numbers from `start` to `end` (both inclusive). +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/js/s/superset-subset-of-array.md b/content/snippets/js/s/superset-subset-of-array.md index 23d45b9618e..53087870e41 100644 --- a/content/snippets/js/s/superset-subset-of-array.md +++ b/content/snippets/js/s/superset-subset-of-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: waves-from-above-2 excerpt: Check if an iterable is a superset of another one, excluding duplicate values. +listed: true dateModified: 2024-01-01 --- diff --git a/content/snippets/js/s/swap-case.md b/content/snippets/js/s/swap-case.md index c002c00df95..6f5753f6976 100644 --- a/content/snippets/js/s/swap-case.md +++ b/content/snippets/js/s/swap-case.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: mountain-lake-2 excerpt: Learn how to create a string with uppercase characters converted to lowercase and vice versa. +listed: true dateModified: 2024-02-10 --- diff --git a/content/snippets/js/s/swap-two-variables.md b/content/snippets/js/s/swap-two-variables.md index e747e4e0aba..9f57ecb4efb 100644 --- a/content/snippets/js/s/swap-two-variables.md +++ b/content/snippets/js/s/swap-two-variables.md @@ -6,6 +6,7 @@ language: javascript tags: [variables] cover: mountain-lake-2 excerpt: Learn how to swap the values of two variables in JavaScript using a single line of ES6 code. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/switch-object.md b/content/snippets/js/s/switch-object.md index b8e406e6979..50fc517a2bd 100644 --- a/content/snippets/js/s/switch-object.md +++ b/content/snippets/js/s/switch-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: rocky-lake excerpt: JavaScript's `switch` statement often feels hard to remember and a little bit out of place. Maybe it's time to use object literals, instead. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/js/s/sync-async.md b/content/snippets/js/s/sync-async.md index 21840ee3034..dacfb1a1da6 100644 --- a/content/snippets/js/s/sync-async.md +++ b/content/snippets/js/s/sync-async.md @@ -6,6 +6,7 @@ language: javascript tags: [function,promise] cover: pineapple-on-green excerpt: Understanding the differences between synchronous and asynchronous code is a crucial piece of knowledge for every web developer. +listed: true dateModified: 2021-11-14 --- diff --git a/content/snippets/js/s/take-elements-by-condition-from-array-start-or-end.md b/content/snippets/js/s/take-elements-by-condition-from-array-start-or-end.md index 0fe82e2dde7..b94f8038b12 100644 --- a/content/snippets/js/s/take-elements-by-condition-from-array-start-or-end.md +++ b/content/snippets/js/s/take-elements-by-condition-from-array-start-or-end.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: sunset-textured-beach excerpt: Learn how to get elements from the start or end of a JavaScript array by condition, using `Array.prototype.slice()`. +listed: true dateModified: 2024-01-08 --- diff --git a/content/snippets/js/s/take-n-elements-from-array-start-or-end.md b/content/snippets/js/s/take-n-elements-from-array-start-or-end.md index 1d8c7d3e95d..3763e3d5385 100644 --- a/content/snippets/js/s/take-n-elements-from-array-start-or-end.md +++ b/content/snippets/js/s/take-n-elements-from-array-start-or-end.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: interior-7 excerpt: Learn how to get the first or last N elements of a JavaScript array, using `Array.prototype.slice()`. +listed: true dateModified: 2023-07-09 --- diff --git a/content/snippets/js/s/ternary-operator.md b/content/snippets/js/s/ternary-operator.md index a4e059fb215..fce20851e85 100644 --- a/content/snippets/js/s/ternary-operator.md +++ b/content/snippets/js/s/ternary-operator.md @@ -6,6 +6,7 @@ language: javascript tags: [condition] cover: red-succulent excerpt: Learn everything you need to know about the conditional (ternary) operator and how to use it in JavaScript. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/textcontent-or-innertext.md b/content/snippets/js/s/textcontent-or-innertext.md index 64a1cc71416..69732ac4a85 100644 --- a/content/snippets/js/s/textcontent-or-innertext.md +++ b/content/snippets/js/s/textcontent-or-innertext.md @@ -6,6 +6,7 @@ language: javascript tags: [browser] cover: dark-city excerpt: While these two properties are very similar, there are some key differences that you should be aware of. +listed: true dateModified: 2023-03-19 --- diff --git a/content/snippets/js/s/the-case-for-trailing-commas.md b/content/snippets/js/s/the-case-for-trailing-commas.md index 9b11b218d8f..b8e46e8b95f 100644 --- a/content/snippets/js/s/the-case-for-trailing-commas.md +++ b/content/snippets/js/s/the-case-for-trailing-commas.md @@ -6,6 +6,7 @@ language: javascript tags: [webdev] cover: contemporary-desk excerpt: Trailing commas are not without controversy. Here's why I think you should use them. +listed: true dateModified: 2023-03-12 --- diff --git a/content/snippets/js/s/this.md b/content/snippets/js/s/this.md index e29e3f37eb3..4830040a42f 100644 --- a/content/snippets/js/s/this.md +++ b/content/snippets/js/s/this.md @@ -6,6 +6,7 @@ language: javascript tags: [function,object] cover: u-got-this excerpt: JavaScript's `this` keyword can confuse beginners and veterans alike. Learn how it works in different scenarios and start using it correctly. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/throttle-function.md b/content/snippets/js/s/throttle-function.md index de5215487f2..b6ed763383d 100644 --- a/content/snippets/js/s/throttle-function.md +++ b/content/snippets/js/s/throttle-function.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [function] cover: beach-overview +excerpt: Creates a throttled function that only invokes the provided function at most once per every `wait` milliseconds +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/js/s/timeout-interval-delay.md b/content/snippets/js/s/timeout-interval-delay.md index 8d37f5c5515..b83e60bdf3f 100644 --- a/content/snippets/js/s/timeout-interval-delay.md +++ b/content/snippets/js/s/timeout-interval-delay.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,timeout] cover: river-house-lights excerpt: Did you know that the delay of `setTimeout()` and `setInterval()` is merely a suggestion? +listed: true dateModified: 2022-10-26 --- diff --git a/content/snippets/js/s/to-roman-numeral.md b/content/snippets/js/s/to-roman-numeral.md index 26511fb4d8a..5518bea0558 100644 --- a/content/snippets/js/s/to-roman-numeral.md +++ b/content/snippets/js/s/to-roman-numeral.md @@ -6,6 +6,7 @@ language: javascript tags: [math,string] cover: ancient-greek-building excerpt: Roman numerals are often used for stylistic reasons, but converting an integer to a roman numeral can be a bit tricky. +listed: true dateModified: 2024-03-12 --- diff --git a/content/snippets/js/s/toggle-array-element.md b/content/snippets/js/s/toggle-array-element.md index c09414262cf..3b35e2db1d3 100644 --- a/content/snippets/js/s/toggle-array-element.md +++ b/content/snippets/js/s/toggle-array-element.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: digital-nomad-7 excerpt: Remove an element from an array if it's included in the array, or push it to the array if it isn't. +listed: true dateModified: 2024-03-23 --- diff --git a/content/snippets/js/s/transform-object-keys.md b/content/snippets/js/s/transform-object-keys.md index 73613833231..ece4e054cfa 100644 --- a/content/snippets/js/s/transform-object-keys.md +++ b/content/snippets/js/s/transform-object-keys.md @@ -6,6 +6,7 @@ language: javascript tags: [object, recursion] cover: symmetry-cloudy-mountain excerpt: Learn how to perform various transformations on the keys of a JavaScript object. +listed: true dateModified: 2024-02-19 --- diff --git a/content/snippets/js/s/transpose-matrix.md b/content/snippets/js/s/transpose-matrix.md index 1d759d43b97..e93f783285c 100644 --- a/content/snippets/js/s/transpose-matrix.md +++ b/content/snippets/js/s/transpose-matrix.md @@ -4,6 +4,8 @@ type: snippet language: javascript tags: [array] cover: camera-zoom +excerpt: Transposes a two-dimensional array. +listed: true dateModified: 2022-04-20 --- diff --git a/content/snippets/js/s/trigger-event.md b/content/snippets/js/s/trigger-event.md index ab9e71e4a87..26704571f32 100644 --- a/content/snippets/js/s/trigger-event.md +++ b/content/snippets/js/s/trigger-event.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,event] cover: cloudy-mountaintop-2 excerpt: Learn how to trigger an event on an HTML element using JavaScript. +listed: true dateModified: 2023-11-03 --- diff --git a/content/snippets/js/s/truncate-string.md b/content/snippets/js/s/truncate-string.md index d99e97812c0..8de59367849 100644 --- a/content/snippets/js/s/truncate-string.md +++ b/content/snippets/js/s/truncate-string.md @@ -6,6 +6,7 @@ language: javascript tags: [string] cover: reflection-on-lake excerpt: String splitting and truncation, both simple and locale-sensitive are possible in JavaScript. Learn how in this guide. +listed: true dateModified: 2023-12-31 --- diff --git a/content/snippets/js/s/truthy-falsy-values.md b/content/snippets/js/s/truthy-falsy-values.md index 70f2402422e..36e6a74cc42 100644 --- a/content/snippets/js/s/truthy-falsy-values.md +++ b/content/snippets/js/s/truthy-falsy-values.md @@ -6,6 +6,7 @@ language: javascript tags: [type,comparison] cover: little-bird excerpt: JavaScript uses type coercion in Boolean contexts, resulting in truthy or falsy values. Get a hang of how it all works in this quick guide. +listed: true dateModified: 2021-09-12 --- diff --git a/content/snippets/js/s/typecheck-array.md b/content/snippets/js/s/typecheck-array.md index 73da79775ed..660e184fe56 100644 --- a/content/snippets/js/s/typecheck-array.md +++ b/content/snippets/js/s/typecheck-array.md @@ -6,6 +6,7 @@ language: javascript tags: [type,array] cover: purple-flower-field excerpt: Make sure to use the correct method when checking if a JavaScript object is an array. +listed: true dateModified: 2022-11-06 --- diff --git a/content/snippets/js/s/typecheck-nodejs-streams.md b/content/snippets/js/s/typecheck-nodejs-streams.md index c8e00546d34..5e72c2d33a7 100644 --- a/content/snippets/js/s/typecheck-nodejs-streams.md +++ b/content/snippets/js/s/typecheck-nodejs-streams.md @@ -6,6 +6,7 @@ language: javascript tags: [node,type] excerpt: Learn how to type check for different types of streams in Node.js. cover: mountain-lake-cottage-2 +listed: true dateModified: 2023-12-21 --- diff --git a/content/snippets/js/s/typecheck-proxy.md b/content/snippets/js/s/typecheck-proxy.md index e62297a886b..84325d713f6 100644 --- a/content/snippets/js/s/typecheck-proxy.md +++ b/content/snippets/js/s/typecheck-proxy.md @@ -6,6 +6,7 @@ language: javascript tags: [object,type,proxy] cover: customs excerpt: Learn how to type check objects at runtime using the powerful Proxy object in JavaScript. +listed: true dateModified: 2023-04-23 --- diff --git a/content/snippets/js/s/undeclared-undefined-null.md b/content/snippets/js/s/undeclared-undefined-null.md index 557274f1241..2753e903a00 100644 --- a/content/snippets/js/s/undeclared-undefined-null.md +++ b/content/snippets/js/s/undeclared-undefined-null.md @@ -6,6 +6,7 @@ language: javascript tags: [type] cover: river-houses excerpt: JavaScript has three different empty states for variables. Learn their differences and how you can check for each one. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/unique-values-in-array-remove-duplicates.md b/content/snippets/js/s/unique-values-in-array-remove-duplicates.md index 0358c8dda88..a38441c347e 100644 --- a/content/snippets/js/s/unique-values-in-array-remove-duplicates.md +++ b/content/snippets/js/s/unique-values-in-array-remove-duplicates.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: architectural excerpt: Easily remove duplicates from a JavaScript array using the built-in `Set` object, and learn a few other tricks along the way. +listed: true dateModified: 2024-01-05 --- diff --git a/content/snippets/js/s/unit-converter-data-structure.md b/content/snippets/js/s/unit-converter-data-structure.md index 8f35695868a..309c50dd465 100644 --- a/content/snippets/js/s/unit-converter-data-structure.md +++ b/content/snippets/js/s/unit-converter-data-structure.md @@ -6,6 +6,7 @@ language: javascript tags: [math,function] cover: tropical-waterfall-2 excerpt: Learn how to create a unit converter data structure in JavaScript that can convert between any compatible units. +listed: true dateModified: 2023-11-08 --- diff --git a/content/snippets/js/s/unwind-object.md b/content/snippets/js/s/unwind-object.md index f9c2f02fa55..0706b761ef6 100644 --- a/content/snippets/js/s/unwind-object.md +++ b/content/snippets/js/s/unwind-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: orange-coffee excerpt: Create an array of objects from an object and one of its array-valued properties. +listed: true dateModified: 2024-06-07 --- diff --git a/content/snippets/js/s/upperize-lowerize-object-keys.md b/content/snippets/js/s/upperize-lowerize-object-keys.md index 92c520a8390..09a4a604d1c 100644 --- a/content/snippets/js/s/upperize-lowerize-object-keys.md +++ b/content/snippets/js/s/upperize-lowerize-object-keys.md @@ -6,6 +6,7 @@ language: javascript tags: [object] excerpt: Convert all the keys of an object to upper or lower case. cover: sofia-tram +listed: true dateModified: 2024-01-10 --- diff --git a/content/snippets/js/s/use-strict.md b/content/snippets/js/s/use-strict.md index e0ba2104f06..0173d8ea788 100644 --- a/content/snippets/js/s/use-strict.md +++ b/content/snippets/js/s/use-strict.md @@ -6,6 +6,7 @@ language: javascript tags: [function,object] cover: palm-tree-house excerpt: JavaScript's strict mode can make your code faster, cleaner and more secure. +listed: true dateModified: 2021-11-28 --- diff --git a/content/snippets/js/s/uuid-generator.md b/content/snippets/js/s/uuid-generator.md index d3e9be59a6c..a86d2bebf33 100644 --- a/content/snippets/js/s/uuid-generator.md +++ b/content/snippets/js/s/uuid-generator.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,node,random] cover: digital-nomad-7 excerpt: Generate a UUID in JavaScript using native APIs in both the browser and Node.js. +listed: true dateModified: 2023-12-27 --- diff --git a/content/snippets/js/s/validate-object-properties.md b/content/snippets/js/s/validate-object-properties.md index 0fbddd3822f..6e71e58b4a5 100644 --- a/content/snippets/js/s/validate-object-properties.md +++ b/content/snippets/js/s/validate-object-properties.md @@ -6,6 +6,7 @@ language: javascript tags: [object] cover: symmetry-cloudy-mountain excerpt: Check the properties of an object against an array of keys or another object to ensure they match. +listed: true dateModified: 2024-03-25 --- diff --git a/content/snippets/js/s/value-as-number.md b/content/snippets/js/s/value-as-number.md index d00b4a54b26..651b2dcc63c 100644 --- a/content/snippets/js/s/value-as-number.md +++ b/content/snippets/js/s/value-as-number.md @@ -6,6 +6,7 @@ language: javascript tags: [browser,input] cover: mac-and-coffee excerpt: Ever wanted to get the value of an HTML input element as a number? Learn an easy way to do it with this handy trick. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/value-not-equal-to-itself.md b/content/snippets/js/s/value-not-equal-to-itself.md index 3e020ffc97a..0615391fa67 100644 --- a/content/snippets/js/s/value-not-equal-to-itself.md +++ b/content/snippets/js/s/value-not-equal-to-itself.md @@ -6,6 +6,7 @@ language: javascript tags: [type,comparison] cover: eagle excerpt: Did you know there's a JavaScript value that's not equal to itself? +listed: true dateModified: 2021-12-12 --- diff --git a/content/snippets/js/s/var-let-const.md b/content/snippets/js/s/var-let-const.md index ba28f2ed803..cc56b770bc9 100644 --- a/content/snippets/js/s/var-let-const.md +++ b/content/snippets/js/s/var-let-const.md @@ -6,6 +6,7 @@ language: javascript tags: [type,variable] cover: green-css excerpt: JavaScript variables can be declared a handful of ways. However, understanding their differences can drastically change the way you code. +listed: true dateModified: 2021-12-02 --- diff --git a/content/snippets/js/s/variable-hoisting.md b/content/snippets/js/s/variable-hoisting.md index 9a14dd22191..22ad62f5cb8 100644 --- a/content/snippets/js/s/variable-hoisting.md +++ b/content/snippets/js/s/variable-hoisting.md @@ -6,6 +6,7 @@ language: javascript tags: [type,variable] cover: boat-port excerpt: Hoisting comes up a lot during JavaScript interviews. It's a concept that may require some getting used to, so read our guide to learn more. +listed: true dateModified: 2023-09-28 --- diff --git a/content/snippets/js/s/variable-scope.md b/content/snippets/js/s/variable-scope.md index cef18bff5dc..99bdd716366 100644 --- a/content/snippets/js/s/variable-scope.md +++ b/content/snippets/js/s/variable-scope.md @@ -6,6 +6,7 @@ language: javascript tags: [type,variable] cover: periscope excerpt: JavaScript developers often get confused by JavaScript's variables and scope. Here's a quick guide to understanding these concepts. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/vector-angle.md b/content/snippets/js/s/vector-angle.md index 927a409ae7a..44b39ff0e1f 100644 --- a/content/snippets/js/s/vector-angle.md +++ b/content/snippets/js/s/vector-angle.md @@ -6,6 +6,7 @@ language: javascript tags: [math] cover: purple-pier excerpt: Learn how to calculate the angle (theta) between two vectors in JavaScript. +listed: true dateModified: 2024-05-16 --- diff --git a/content/snippets/js/s/void-links.md b/content/snippets/js/s/void-links.md index a0f9d7d7d72..3a464ee6d99 100644 --- a/content/snippets/js/s/void-links.md +++ b/content/snippets/js/s/void-links.md @@ -5,6 +5,7 @@ language: javascript tags: [browser,accessibility] cover: white-flower excerpt: There are many ways to create empty links, some more appropriate than others. Learn how to best handle empty links with this quick tip. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/js/s/walk-through-object.md b/content/snippets/js/s/walk-through-object.md index 54d06046374..814cc892f00 100644 --- a/content/snippets/js/s/walk-through-object.md +++ b/content/snippets/js/s/walk-through-object.md @@ -6,6 +6,7 @@ language: javascript tags: [object,recursion,generator] cover: bridge excerpt: Create a generator that walks through all the keys of a given object. +listed: true dateModified: 2024-06-05 --- diff --git a/content/snippets/js/s/weekday-name.md b/content/snippets/js/s/weekday-name.md index 471043dd31b..2c9aa61a206 100644 --- a/content/snippets/js/s/weekday-name.md +++ b/content/snippets/js/s/weekday-name.md @@ -6,6 +6,7 @@ language: javascript tags: [date] cover: interior excerpt: Get the name of the weekday from a JavaScript `Date` object. +listed: true dateModified: 2024-05-21 --- diff --git a/content/snippets/js/s/window-location-cheatsheet.md b/content/snippets/js/s/window-location-cheatsheet.md index 5f4f8902919..dafda7989a8 100644 --- a/content/snippets/js/s/window-location-cheatsheet.md +++ b/content/snippets/js/s/window-location-cheatsheet.md @@ -5,6 +5,7 @@ language: javascript tags: [browser,cheatsheet] cover: yellow-sofa excerpt: A quick reference for the `window.location` object. +listed: true dateModified: 2022-12-21 --- diff --git a/content/snippets/js/s/word-wrap.md b/content/snippets/js/s/word-wrap.md index c9519d46082..93088ab681d 100644 --- a/content/snippets/js/s/word-wrap.md +++ b/content/snippets/js/s/word-wrap.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: white-tablet excerpt: Wrap a string to a given number of characters using a string break character in JavaScript. +listed: true dateModified: 2024-02-29 --- diff --git a/content/snippets/js/s/yes-no.md b/content/snippets/js/s/yes-no.md index a9071cefe42..f549eb456bc 100644 --- a/content/snippets/js/s/yes-no.md +++ b/content/snippets/js/s/yes-no.md @@ -6,6 +6,7 @@ language: javascript tags: [string,regexp] cover: fort-lamp excerpt: Quickly and easily check if a string is a yes/no answer to a boolean question in your CLI programs. +listed: true dateModified: 2023-12-15 --- diff --git a/content/snippets/js/s/zip-unzip-array.md b/content/snippets/js/s/zip-unzip-array.md index 38752a7277c..09779bdeb17 100644 --- a/content/snippets/js/s/zip-unzip-array.md +++ b/content/snippets/js/s/zip-unzip-array.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: new-york-skyline excerpt: Learn how to implement array zipping, a grouping of elements based on position in the original arrays, and its inverse, unzipping. +listed: true dateModified: 2024-01-11 --- diff --git a/content/snippets/js/snippet-template.md b/content/snippets/js/snippet-template.md index e2e5e2f0310..fae4f6f6a3a 100644 --- a/content/snippets/js/snippet-template.md +++ b/content/snippets/js/snippet-template.md @@ -6,6 +6,7 @@ language: javascript tags: [array] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/python/s/6-f-strings-tips.md b/content/snippets/python/s/6-f-strings-tips.md index 6aa4d0998e5..fcdfdce93f6 100644 --- a/content/snippets/python/s/6-f-strings-tips.md +++ b/content/snippets/python/s/6-f-strings-tips.md @@ -5,6 +5,7 @@ language: python tags: [string] cover: sea-view excerpt: Python's f-strings can do a lot more than you might expect. Learn a few useful tips and tricks in this quick guide. +listed: true dateModified: 2021-07-20 --- diff --git a/content/snippets/python/s/add-days.md b/content/snippets/python/s/add-days.md index 41188e1b9d2..cae94c45a5e 100644 --- a/content/snippets/python/s/add-days.md +++ b/content/snippets/python/s/add-days.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: orange-flower +excerpt: Calculates the date of `n` days from the given date. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/all-equal.md b/content/snippets/python/s/all-equal.md index 2d9c61e77ce..1362056f6c8 100644 --- a/content/snippets/python/s/all-equal.md +++ b/content/snippets/python/s/all-equal.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: fallen-leaves +excerpt: Checks if all elements in a list are equal. +listed: true dateModified: 2020-10-11 --- diff --git a/content/snippets/python/s/all-unique.md b/content/snippets/python/s/all-unique.md index 1334e23e1d8..018a8a71297 100644 --- a/content/snippets/python/s/all-unique.md +++ b/content/snippets/python/s/all-unique.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: touch-flower +excerpt: Checks if all the values in a list are unique. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/python/s/arithmetic-progression.md b/content/snippets/python/s/arithmetic-progression.md index f56db543a81..794e2e26ff7 100644 --- a/content/snippets/python/s/arithmetic-progression.md +++ b/content/snippets/python/s/arithmetic-progression.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: number-2 +excerpt: Generates a list of numbers in the arithmetic progression starting with the given positive integer and up to the specified limit. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/average-by.md b/content/snippets/python/s/average-by.md index 11a5a363b52..a320a1ab8de 100644 --- a/content/snippets/python/s/average-by.md +++ b/content/snippets/python/s/average-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: flower-vase +excerpt: Calculates the average of a list, after mapping each element to a value using the provided function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/average.md b/content/snippets/python/s/average.md index f4a357d836a..c051985bc8e 100644 --- a/content/snippets/python/s/average.md +++ b/content/snippets/python/s/average.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: digital-nomad-15 +excerpt: Calculates the average of two or more numbers. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/bare-except.md b/content/snippets/python/s/bare-except.md index c971ce19939..d4eeb5fcde0 100644 --- a/content/snippets/python/s/bare-except.md +++ b/content/snippets/python/s/bare-except.md @@ -6,6 +6,7 @@ language: python tags: [error] cover: dark-cloud excerpt: It's generally not a good idea to use bare `except` clause in Python, but do you know why? +listed: true dateModified: 2022-02-20 --- diff --git a/content/snippets/python/s/bifurcate-by.md b/content/snippets/python/s/bifurcate-by.md index 038da967ff7..91b242f7184 100644 --- a/content/snippets/python/s/bifurcate-by.md +++ b/content/snippets/python/s/bifurcate-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: two-flower-vases +excerpt: Splits values into two groups, based on the result of the given filtering function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/bifurcate.md b/content/snippets/python/s/bifurcate.md index a1c8bf7e1e6..8fb593092a0 100644 --- a/content/snippets/python/s/bifurcate.md +++ b/content/snippets/python/s/bifurcate.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: mug-flower-book +excerpt: Splits values into two groups, based on the result of the given `filter` list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/binomial-coefficient.md b/content/snippets/python/s/binomial-coefficient.md index 509aba42f31..83af540dbea 100644 --- a/content/snippets/python/s/binomial-coefficient.md +++ b/content/snippets/python/s/binomial-coefficient.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: digital-nomad-5 +excerpt: Calculates the number of ways to choose `k` items from `n` items without repetition and without order. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/byte-size.md b/content/snippets/python/s/byte-size.md index 36e2159eee4..9a2903a29c6 100644 --- a/content/snippets/python/s/byte-size.md +++ b/content/snippets/python/s/byte-size.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: river-house-lights +excerpt: Returns the length of a string in bytes. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/camel.md b/content/snippets/python/s/camel.md index 0647244cbe5..88f44668744 100644 --- a/content/snippets/python/s/camel.md +++ b/content/snippets/python/s/camel.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,regexp] cover: digital-nomad-9 +excerpt: Converts a string to camelcase. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/capitalize-every-word.md b/content/snippets/python/s/capitalize-every-word.md index 0de8e470f7c..82a046c0930 100644 --- a/content/snippets/python/s/capitalize-every-word.md +++ b/content/snippets/python/s/capitalize-every-word.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: trippy-chemicals +excerpt: Capitalizes the first letter of every word in a string. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/capitalize.md b/content/snippets/python/s/capitalize.md index 4ab8657ae9d..883dd5dd685 100644 --- a/content/snippets/python/s/capitalize.md +++ b/content/snippets/python/s/capitalize.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: palm-tree-house +excerpt: Capitalizes the first letter of a string. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/cast-list.md b/content/snippets/python/s/cast-list.md index d8219a569fc..f7f2ca45df6 100644 --- a/content/snippets/python/s/cast-list.md +++ b/content/snippets/python/s/cast-list.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: colorful-pots +excerpt: Casts the provided value as a list if it's not one. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/check-prop.md b/content/snippets/python/s/check-prop.md index 6e8f615a3d6..f6d5a9415ab 100644 --- a/content/snippets/python/s/check-prop.md +++ b/content/snippets/python/s/check-prop.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: lake-trees +excerpt: Creates a function that will invoke a predicate function for the specified property on a given dictionary. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/chunk-into-n.md b/content/snippets/python/s/chunk-into-n.md index ccc1885a54a..96080f5ef05 100644 --- a/content/snippets/python/s/chunk-into-n.md +++ b/content/snippets/python/s/chunk-into-n.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-10 +excerpt: Chunks a list into `n` smaller lists. +listed: true dateModified: 2020-10-23 --- diff --git a/content/snippets/python/s/chunk.md b/content/snippets/python/s/chunk.md index 188bbbb4ecc..5a4d902632a 100644 --- a/content/snippets/python/s/chunk.md +++ b/content/snippets/python/s/chunk.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: red-berries +excerpt: Chunks a list into smaller lists of a specified size. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/clamp-number.md b/content/snippets/python/s/clamp-number.md index 69907250c10..6ddfe246d4e 100644 --- a/content/snippets/python/s/clamp-number.md +++ b/content/snippets/python/s/clamp-number.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: colorful-rocks +excerpt: Clamps `num` within the inclusive range specified by the boundary values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/code-anatomy-performant-python.md b/content/snippets/python/s/code-anatomy-performant-python.md index b2a3bd490ca..609e5bb9076 100644 --- a/content/snippets/python/s/code-anatomy-performant-python.md +++ b/content/snippets/python/s/code-anatomy-performant-python.md @@ -6,6 +6,7 @@ language: python tags: [list,performance] cover: walking-on-top excerpt: Writing efficient Python code can be tricky. Read how we optimize our list snippets to increase performance using a couple of simple tricks. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/python/s/collect-dictionary.md b/content/snippets/python/s/collect-dictionary.md index 6e776612b28..7a20a886daa 100644 --- a/content/snippets/python/s/collect-dictionary.md +++ b/content/snippets/python/s/collect-dictionary.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: working-bee +excerpt: Inverts a dictionary with non-unique hashable values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/combine-values.md b/content/snippets/python/s/combine-values.md index af0f6f25074..bf2b760ef04 100644 --- a/content/snippets/python/s/combine-values.md +++ b/content/snippets/python/s/combine-values.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: dim-mountains +excerpt: Combines two or more dictionaries, creating a list of values for each key. +listed: true dateModified: 2021-04-04 --- diff --git a/content/snippets/python/s/compact.md b/content/snippets/python/s/compact.md index fa727ebd952..013073c6f46 100644 --- a/content/snippets/python/s/compact.md +++ b/content/snippets/python/s/compact.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: new-plant +excerpt: Removes falsy values from a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/compose-right.md b/content/snippets/python/s/compose-right.md index 5637f8a20ec..1191fafc933 100644 --- a/content/snippets/python/s/compose-right.md +++ b/content/snippets/python/s/compose-right.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: lavender-shelf +excerpt: Performs left-to-right function composition. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/compose.md b/content/snippets/python/s/compose.md index 7c61afcf98b..82a02f05e54 100644 --- a/content/snippets/python/s/compose.md +++ b/content/snippets/python/s/compose.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: tram-car-2 +excerpt: Performs right-to-left function composition. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/count-by.md b/content/snippets/python/s/count-by.md index 94e3c096e54..b732d83f365 100644 --- a/content/snippets/python/s/count-by.md +++ b/content/snippets/python/s/count-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: rabbit-call +excerpt: Groups the elements of a list based on the given function and returns the count of elements in each group. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/count-occurrences.md b/content/snippets/python/s/count-occurrences.md index e2576d0a594..ea3640b0f69 100644 --- a/content/snippets/python/s/count-occurrences.md +++ b/content/snippets/python/s/count-occurrences.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: pineapple-at-work +excerpt: Counts the occurrences of a value in a list. +listed: true dateModified: 2021-01-10 --- diff --git a/content/snippets/python/s/cumsum.md b/content/snippets/python/s/cumsum.md index 8e13bec7e05..639fd914ca0 100644 --- a/content/snippets/python/s/cumsum.md +++ b/content/snippets/python/s/cumsum.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: digital-nomad-16 +excerpt: Creates a list of partial sums. +listed: true dateModified: 2021-01-13 --- diff --git a/content/snippets/python/s/curry.md b/content/snippets/python/s/curry.md index 0e529dc014d..21f52b021fd 100644 --- a/content/snippets/python/s/curry.md +++ b/content/snippets/python/s/curry.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: leaves-read +excerpt: Curries a function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/daterange.md b/content/snippets/python/s/daterange.md index 73410728a27..c4280edf33f 100644 --- a/content/snippets/python/s/daterange.md +++ b/content/snippets/python/s/daterange.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: maple-leaf-palette +excerpt: Creates a list of dates between `start` (inclusive) and `end` (not inclusive). +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/python/s/days-ago.md b/content/snippets/python/s/days-ago.md index 228ec46c8f0..d8218780372 100644 --- a/content/snippets/python/s/days-ago.md +++ b/content/snippets/python/s/days-ago.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: cup-of-orange +excerpt: Calculates the date of `n` days ago from today. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/days-diff.md b/content/snippets/python/s/days-diff.md index 99727dc2c1f..50ca7848470 100644 --- a/content/snippets/python/s/days-diff.md +++ b/content/snippets/python/s/days-diff.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: succulent-9 +excerpt: Calculates the day difference between two dates. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/days-from-now.md b/content/snippets/python/s/days-from-now.md index 0eaba850c1a..20c74ab6d66 100644 --- a/content/snippets/python/s/days-from-now.md +++ b/content/snippets/python/s/days-from-now.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: clutter +excerpt: Calculates the date of `n` days from today. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/decapitalize.md b/content/snippets/python/s/decapitalize.md index 5d4fd5bab43..55e926e771a 100644 --- a/content/snippets/python/s/decapitalize.md +++ b/content/snippets/python/s/decapitalize.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: succulent-crowd +excerpt: Decapitalizes the first letter of a string. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/deep-flatten.md b/content/snippets/python/s/deep-flatten.md index 030972f759a..f7fdebbc95f 100644 --- a/content/snippets/python/s/deep-flatten.md +++ b/content/snippets/python/s/deep-flatten.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,recursion] cover: standing-stones +excerpt: Deep flattens a list. +listed: true dateModified: 2020-12-29 --- diff --git a/content/snippets/python/s/delay.md b/content/snippets/python/s/delay.md index f6631aa0ee5..4bf3032ac57 100644 --- a/content/snippets/python/s/delay.md +++ b/content/snippets/python/s/delay.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: succulent-10 +excerpt: Invokes the provided function after `ms` milliseconds. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/dict-getkey-vs-dictkey.md b/content/snippets/python/s/dict-getkey-vs-dictkey.md index 7bc19b6e1ad..56f0f1e9281 100644 --- a/content/snippets/python/s/dict-getkey-vs-dictkey.md +++ b/content/snippets/python/s/dict-getkey-vs-dictkey.md @@ -6,6 +6,7 @@ language: python tags: [dictionary] cover: compass-2 excerpt: Learn the difference between two common ways to access values in Python dictionaries and level up your code today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/dict-to-list.md b/content/snippets/python/s/dict-to-list.md index 2c18ff740c3..3f79d09c786 100644 --- a/content/snippets/python/s/dict-to-list.md +++ b/content/snippets/python/s/dict-to-list.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary,list] cover: new-york +excerpt: Converts a dictionary to a list of tuples. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/difference-by.md b/content/snippets/python/s/difference-by.md index 7d46d89eb04..e66c4dde8c6 100644 --- a/content/snippets/python/s/difference-by.md +++ b/content/snippets/python/s/difference-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,function] cover: coconuts +excerpt: Returns the difference between two lists, after applying the provided function to each list element of both. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/difference.md b/content/snippets/python/s/difference.md index 75d1a7284d3..2bdc51b7252 100644 --- a/content/snippets/python/s/difference.md +++ b/content/snippets/python/s/difference.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: frog-blue-flower +excerpt: Calculates the difference between two iterables, without filtering duplicate values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/digitize.md b/content/snippets/python/s/digitize.md index 69ff3e24234..479d828cfd1 100644 --- a/content/snippets/python/s/digitize.md +++ b/content/snippets/python/s/digitize.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: laptop-with-code +excerpt: Converts a number to a list of digits. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/drop-right.md b/content/snippets/python/s/drop-right.md index 604417ebbf7..7a35d52a0ee 100644 --- a/content/snippets/python/s/drop-right.md +++ b/content/snippets/python/s/drop-right.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: digital-nomad-7 +excerpt: Returns a list with `n` elements removed from the right. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/drop.md b/content/snippets/python/s/drop.md index ff2722d6364..caa35e8e9c3 100644 --- a/content/snippets/python/s/drop.md +++ b/content/snippets/python/s/drop.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: pink-flower +excerpt: Returns a list with `n` elements removed from the left. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/empty-list.md b/content/snippets/python/s/empty-list.md index 38f7d7b0c29..3880dc5a001 100644 --- a/content/snippets/python/s/empty-list.md +++ b/content/snippets/python/s/empty-list.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: salad-2 excerpt: There's a good way to test the emptiness of a Python list and a better one. Which one are you using? +listed: true dateModified: 2023-01-15 --- diff --git a/content/snippets/python/s/every-nth.md b/content/snippets/python/s/every-nth.md index 8b917a890f5..375c2391814 100644 --- a/content/snippets/python/s/every-nth.md +++ b/content/snippets/python/s/every-nth.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: cherry-trees +excerpt: Returns every `nth` element in a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/every.md b/content/snippets/python/s/every.md index 1446ee53255..55ed5fa3b68 100644 --- a/content/snippets/python/s/every.md +++ b/content/snippets/python/s/every.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: walking +excerpt: Checks if the provided function returns `True` for every element in the list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/file-close.md b/content/snippets/python/s/file-close.md index 0ad592e1bf7..351976adba6 100644 --- a/content/snippets/python/s/file-close.md +++ b/content/snippets/python/s/file-close.md @@ -6,6 +6,7 @@ language: python tags: [file] cover: flower-pond excerpt: When working with files in Python, it's important to ensure that the file is closed correctly. Here are a couple of ways to do that. +listed: true dateModified: 2022-02-03 --- diff --git a/content/snippets/python/s/filter-non-unique.md b/content/snippets/python/s/filter-non-unique.md index 01c16a7e2cf..402bbe90389 100644 --- a/content/snippets/python/s/filter-non-unique.md +++ b/content/snippets/python/s/filter-non-unique.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: cobbled-street +excerpt: Creates a list with the non-unique values filtered out. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/filter-unique.md b/content/snippets/python/s/filter-unique.md index 3ac18c1ea4b..cbc93bc99e5 100644 --- a/content/snippets/python/s/filter-unique.md +++ b/content/snippets/python/s/filter-unique.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: feathers +excerpt: Creates a list with the unique values filtered out. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-index-of-all.md b/content/snippets/python/s/find-index-of-all.md index b63223745c4..1d08c03f072 100644 --- a/content/snippets/python/s/find-index-of-all.md +++ b/content/snippets/python/s/find-index-of-all.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: tree-roots +excerpt: Finds the indexes of all elements in the given list that satisfy the provided testing function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-index.md b/content/snippets/python/s/find-index.md index 85f6cf93b05..df75dea65d7 100644 --- a/content/snippets/python/s/find-index.md +++ b/content/snippets/python/s/find-index.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: light-ring +excerpt: Finds the index of the first element in the given list that satisfies the provided testing function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-key.md b/content/snippets/python/s/find-key.md index af9b3970567..4706803c7cb 100644 --- a/content/snippets/python/s/find-key.md +++ b/content/snippets/python/s/find-key.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: blue-red-mountain +excerpt: Finds the first key in the provided dictionary that has the given value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-keys.md b/content/snippets/python/s/find-keys.md index 10912f64545..f3a397b5c43 100644 --- a/content/snippets/python/s/find-keys.md +++ b/content/snippets/python/s/find-keys.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: laptop-plants-2 +excerpt: Finds all keys in the provided dictionary that have the given value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-last-index.md b/content/snippets/python/s/find-last-index.md index a6eeaeecffc..f3ecef9a5aa 100644 --- a/content/snippets/python/s/find-last-index.md +++ b/content/snippets/python/s/find-last-index.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-8 +excerpt: Finds the index of the last element in the given list that satisfies the provided testing function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-last.md b/content/snippets/python/s/find-last.md index 6715849daf5..8b822c2ec9e 100644 --- a/content/snippets/python/s/find-last.md +++ b/content/snippets/python/s/find-last.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: tropical-waterfall +excerpt: Finds the value of the last element in the given list that satisfies the provided testing function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find-parity-outliers.md b/content/snippets/python/s/find-parity-outliers.md index b94023672a7..78fccb2a07f 100644 --- a/content/snippets/python/s/find-parity-outliers.md +++ b/content/snippets/python/s/find-parity-outliers.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,math] cover: nature-screen +excerpt: Finds the items that are parity outliers in a given list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/find.md b/content/snippets/python/s/find.md index de264a9198c..61e83bd67a3 100644 --- a/content/snippets/python/s/find.md +++ b/content/snippets/python/s/find.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: angry-waves +excerpt: Finds the value of the first element in the given list that satisfies the provided testing function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/flatten.md b/content/snippets/python/s/flatten.md index 5fc268addeb..b10048a0662 100644 --- a/content/snippets/python/s/flatten.md +++ b/content/snippets/python/s/flatten.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: jars-on-shelf +excerpt: Flattens a list of lists once. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/for-each-right.md b/content/snippets/python/s/for-each-right.md index 04909b0e7ae..77a4c4e9608 100644 --- a/content/snippets/python/s/for-each-right.md +++ b/content/snippets/python/s/for-each-right.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: bridge-drop +excerpt: Executes the provided function once for each list element, starting from the list's last element. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/for-each.md b/content/snippets/python/s/for-each.md index 5e93cfe4fbe..ab58c352ada 100644 --- a/content/snippets/python/s/for-each.md +++ b/content/snippets/python/s/for-each.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: green-plant +excerpt: Executes the provided function once for each list element. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/frequencies.md b/content/snippets/python/s/frequencies.md index 40adc7311fb..3d65646eff1 100644 --- a/content/snippets/python/s/frequencies.md +++ b/content/snippets/python/s/frequencies.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-6 +excerpt: Creates a dictionary with the unique values of a list as keys and their frequencies as the values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/from-iso-date.md b/content/snippets/python/s/from-iso-date.md index f2157414f5e..6d9116dd478 100644 --- a/content/snippets/python/s/from-iso-date.md +++ b/content/snippets/python/s/from-iso-date.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: purple-leaves +excerpt: Converts a date from its ISO-8601 representation. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/python/s/fstrings-str-format.md b/content/snippets/python/s/fstrings-str-format.md index 0200dd28874..88bbf0b8a4a 100644 --- a/content/snippets/python/s/fstrings-str-format.md +++ b/content/snippets/python/s/fstrings-str-format.md @@ -6,6 +6,7 @@ language: python tags: [string] cover: feathers excerpt: Learn two ways to format a string in Python with this quick tip. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/gcd.md b/content/snippets/python/s/gcd.md index a0757d9e729..d2aad8c92ec 100644 --- a/content/snippets/python/s/gcd.md +++ b/content/snippets/python/s/gcd.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: digital-nomad-12 +excerpt: Calculates the greatest common divisor of a list of numbers. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/geometric-progression.md b/content/snippets/python/s/geometric-progression.md index 079f667f573..21e4f3444d2 100644 --- a/content/snippets/python/s/geometric-progression.md +++ b/content/snippets/python/s/geometric-progression.md @@ -5,6 +5,7 @@ language: python tags: [math,list] cover: kettle-laptop excerpt: Initializes a list containing the numbers in the specified geometric progression range. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/get.md b/content/snippets/python/s/get.md index 152e4ce850a..38f3550bbfe 100644 --- a/content/snippets/python/s/get.md +++ b/content/snippets/python/s/get.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary,list] cover: digital-nomad-2 +excerpt: Retrieves the value of the nested key indicated by the given selector list from a dictionary or list. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/group-by.md b/content/snippets/python/s/group-by.md index 40e06a11681..fa5a22ca690 100644 --- a/content/snippets/python/s/group-by.md +++ b/content/snippets/python/s/group-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,dictionary] cover: body-of-water +excerpt: Groups the elements of a list based on the given function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/hamming-distance.md b/content/snippets/python/s/hamming-distance.md index 84509f60ef1..d351f800fb1 100644 --- a/content/snippets/python/s/hamming-distance.md +++ b/content/snippets/python/s/hamming-distance.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: tulips-and-reeds +excerpt: Calculates the Hamming distance between two values. +listed: true dateModified: 2021-02-18 --- diff --git a/content/snippets/python/s/has-duplicates.md b/content/snippets/python/s/has-duplicates.md index 99dcd58ac18..ec91f88ac1a 100644 --- a/content/snippets/python/s/has-duplicates.md +++ b/content/snippets/python/s/has-duplicates.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: jars-on-shelf-2 +excerpt: Checks if there are duplicate values in a flat list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/have-same-contents.md b/content/snippets/python/s/have-same-contents.md index 3f71995fd46..fb63ca2e277 100644 --- a/content/snippets/python/s/have-same-contents.md +++ b/content/snippets/python/s/have-same-contents.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: racoon +excerpt: Checks if two lists contain the same elements regardless of order. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/head.md b/content/snippets/python/s/head.md index 3f0c4728d96..107d463e98c 100644 --- a/content/snippets/python/s/head.md +++ b/content/snippets/python/s/head.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: purple-laptop +excerpt: Returns the head of a list. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/hex-to-rgb.md b/content/snippets/python/s/hex-to-rgb.md index b85135c2053..b1477507376 100644 --- a/content/snippets/python/s/hex-to-rgb.md +++ b/content/snippets/python/s/hex-to-rgb.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,math] cover: sleepy-cat +excerpt: Converts a hexadecimal color code to a tuple of integers corresponding to its RGB components. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/identity-equality.md b/content/snippets/python/s/identity-equality.md index 27a5cf7cc6a..8b9f764bf24 100644 --- a/content/snippets/python/s/identity-equality.md +++ b/content/snippets/python/s/identity-equality.md @@ -6,6 +6,7 @@ language: python tags: [type,comparison] cover: umbrellas excerpt: Python provides two distinct comparison operators for different task. Stop mixing them up using this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/in-range.md b/content/snippets/python/s/in-range.md index 78cb7270cac..8be0124161b 100644 --- a/content/snippets/python/s/in-range.md +++ b/content/snippets/python/s/in-range.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: pineapple-on-green +excerpt: Checks if the given number falls within the given range. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/includes-all.md b/content/snippets/python/s/includes-all.md index b7e9528bc9f..d505017be04 100644 --- a/content/snippets/python/s/includes-all.md +++ b/content/snippets/python/s/includes-all.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: switzerland-night +excerpt: Checks if all the elements in `values` are included in `lst`. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/includes-any.md b/content/snippets/python/s/includes-any.md index 034ffabff70..c4bb8324db2 100644 --- a/content/snippets/python/s/includes-any.md +++ b/content/snippets/python/s/includes-any.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: forest-balcony +excerpt: Checks if any element in `values` is included in `lst`. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/index-of-all.md b/content/snippets/python/s/index-of-all.md index 2bd102ba143..0b28c2e3057 100644 --- a/content/snippets/python/s/index-of-all.md +++ b/content/snippets/python/s/index-of-all.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: purple-flower-bunch +excerpt: Returns a list of indexes of all the occurrences of an element in a list. +listed: true dateModified: 2020-10-11 --- diff --git a/content/snippets/python/s/initial.md b/content/snippets/python/s/initial.md index f0c8e7853ba..59b1c4ca2af 100644 --- a/content/snippets/python/s/initial.md +++ b/content/snippets/python/s/initial.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: pop-of-green +excerpt: Returns all the elements of a list except the last one. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/initialize-2-d-list.md b/content/snippets/python/s/initialize-2-d-list.md index 26108b1d700..954b01c55ba 100644 --- a/content/snippets/python/s/initialize-2-d-list.md +++ b/content/snippets/python/s/initialize-2-d-list.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-7 +excerpt: Initializes a 2D list of given width and height and value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/initialize-list-with-range.md b/content/snippets/python/s/initialize-list-with-range.md index 6ac302cbfc8..6d3a07b6fb4 100644 --- a/content/snippets/python/s/initialize-list-with-range.md +++ b/content/snippets/python/s/initialize-list-with-range.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-3 +excerpt: Initializes a list containing the numbers in the specified range where `start` and `end` are inclusive with their common difference `step`. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/initialize-list-with-values.md b/content/snippets/python/s/initialize-list-with-values.md index 315950e89b6..cf9e954b353 100644 --- a/content/snippets/python/s/initialize-list-with-values.md +++ b/content/snippets/python/s/initialize-list-with-values.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: dog-waiting +excerpt: Initializes and fills a list with the specified value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/intersection-by.md b/content/snippets/python/s/intersection-by.md index 13ec81d9bb5..76b28d13c28 100644 --- a/content/snippets/python/s/intersection-by.md +++ b/content/snippets/python/s/intersection-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,function] cover: camper-school-bus +excerpt: Returns a list of elements that exist in both lists, after applying the provided function to each list element of both. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/intersection.md b/content/snippets/python/s/intersection.md index 82b00fd8e71..0b10434a603 100644 --- a/content/snippets/python/s/intersection.md +++ b/content/snippets/python/s/intersection.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: wooden-bowl +excerpt: Returns a list of elements that exist in both lists. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/invert-dictionary.md b/content/snippets/python/s/invert-dictionary.md index 8b1a059e807..944aded4492 100644 --- a/content/snippets/python/s/invert-dictionary.md +++ b/content/snippets/python/s/invert-dictionary.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: rustic-cup +excerpt: Inverts a dictionary with unique hashable values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/is-anagram.md b/content/snippets/python/s/is-anagram.md index 22edfe76aff..c4d905b5181 100644 --- a/content/snippets/python/s/is-anagram.md +++ b/content/snippets/python/s/is-anagram.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: digital-nomad-8 +excerpt: Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters). +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/is-contained-in.md b/content/snippets/python/s/is-contained-in.md index 69a091e1f5c..f2e62fe7f8e 100644 --- a/content/snippets/python/s/is-contained-in.md +++ b/content/snippets/python/s/is-contained-in.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: sunrise-over-mountains +excerpt: Checks if the elements of the first list are contained in the second one regardless of order. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/python/s/is-divisible.md b/content/snippets/python/s/is-divisible.md index a7ad2ea6a92..00fffc91084 100644 --- a/content/snippets/python/s/is-divisible.md +++ b/content/snippets/python/s/is-divisible.md @@ -3,8 +3,9 @@ title: Number is divisible type: snippet language: python tags: [math] -unlisted: true cover: interior-9 +excerpt: Checks if the first numeric argument is divisible by the second one. +listed: false dateModified: 2021-01-04 --- diff --git a/content/snippets/python/s/is-empty.md b/content/snippets/python/s/is-empty.md index 89eebd99076..63caf5db161 100644 --- a/content/snippets/python/s/is-empty.md +++ b/content/snippets/python/s/is-empty.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,dictionary,string] cover: salad-1 +excerpt: Checks if the a value is an empty sequence or collection. +listed: true dateModified: 2023-01-12 --- diff --git a/content/snippets/python/s/is-prime.md b/content/snippets/python/s/is-prime.md index ac11200c818..a9de3f80731 100644 --- a/content/snippets/python/s/is-prime.md +++ b/content/snippets/python/s/is-prime.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: carrots +excerpt: Checks if the provided integer is a prime number. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/is-weekday.md b/content/snippets/python/s/is-weekday.md index 9ed2d651560..72ea60b0237 100644 --- a/content/snippets/python/s/is-weekday.md +++ b/content/snippets/python/s/is-weekday.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: succulent-4 +excerpt: Checks if the given date is a weekday. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/is-weekend.md b/content/snippets/python/s/is-weekend.md index 6f441c8a684..449ed4fda53 100644 --- a/content/snippets/python/s/is-weekend.md +++ b/content/snippets/python/s/is-weekend.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: two-lighthouses +excerpt: Checks if the given date is a weekend. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/iterable-is-permutation.md b/content/snippets/python/s/iterable-is-permutation.md index e6db80236cc..84375a86e9a 100644 --- a/content/snippets/python/s/iterable-is-permutation.md +++ b/content/snippets/python/s/iterable-is-permutation.md @@ -5,6 +5,8 @@ type: snippet language: python tags: [list,string] cover: apples +excerpt: Check if two iterables are permutations of each other. +listed: true dateModified: 2023-05-23 --- diff --git a/content/snippets/python/s/kebab.md b/content/snippets/python/s/kebab.md index 081933c9bd8..41023d94794 100644 --- a/content/snippets/python/s/kebab.md +++ b/content/snippets/python/s/kebab.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,regexp] cover: peaches +excerpt: Converts a string to kebab case. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/key-in-dict.md b/content/snippets/python/s/key-in-dict.md index 6377fedae90..eab081458b8 100644 --- a/content/snippets/python/s/key-in-dict.md +++ b/content/snippets/python/s/key-in-dict.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: rocky-mountains +excerpt: Checks if the given key exists in a dictionary. +listed: true dateModified: 2020-10-16 --- diff --git a/content/snippets/python/s/key-of-min-max.md b/content/snippets/python/s/key-of-min-max.md index 4ad95a61ac9..6fb8ff00dd5 100644 --- a/content/snippets/python/s/key-of-min-max.md +++ b/content/snippets/python/s/key-of-min-max.md @@ -6,6 +6,7 @@ language: python tags: [dictionary] cover: goat-wooden-cottage excerpt: Find the key of the minimum or maximum value in a Python dictionary. +listed: true dateModified: 2024-05-08 --- diff --git a/content/snippets/python/s/keys-only.md b/content/snippets/python/s/keys-only.md index 7dc0756f198..4768e080ab8 100644 --- a/content/snippets/python/s/keys-only.md +++ b/content/snippets/python/s/keys-only.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary,list] cover: succulent-5 +excerpt: Creates a flat list of all the keys in a flat dictionary. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/last.md b/content/snippets/python/s/last.md index 59a09336790..1d9b06fbdc6 100644 --- a/content/snippets/python/s/last.md +++ b/content/snippets/python/s/last.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: lake-runner +excerpt: Returns the last element in a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/lcm.md b/content/snippets/python/s/lcm.md index 84f2a8dc409..c2fea0e6de9 100644 --- a/content/snippets/python/s/lcm.md +++ b/content/snippets/python/s/lcm.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: chess-pawns +excerpt: Returns the least common multiple of a list of numbers. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/lists-tuples.md b/content/snippets/python/s/lists-tuples.md index 46ca5b5d0a3..3f80ca91a84 100644 --- a/content/snippets/python/s/lists-tuples.md +++ b/content/snippets/python/s/lists-tuples.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: red-mountain excerpt: Learn how Python's lists and tuples are different and level up your code today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/longest-item.md b/content/snippets/python/s/longest-item.md index 1d30e6f2b21..1e2b05d31c7 100644 --- a/content/snippets/python/s/longest-item.md +++ b/content/snippets/python/s/longest-item.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,string] cover: keyboard-tea +excerpt: Takes any number of iterable objects or objects with a length property and returns the longest one. +listed: true dateModified: 2021-10-17 --- diff --git a/content/snippets/python/s/lowercase.md b/content/snippets/python/s/lowercase.md index e02e09d7126..4ce4f6cd905 100644 --- a/content/snippets/python/s/lowercase.md +++ b/content/snippets/python/s/lowercase.md @@ -6,6 +6,7 @@ language: python tags: [string] cover: type-stamps excerpt: Learn of the two different ways to convert strings to lowercase in Python and understand when you should use each one with this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/map-dictionary.md b/content/snippets/python/s/map-dictionary.md index afc3f96965a..72547a29223 100644 --- a/content/snippets/python/s/map-dictionary.md +++ b/content/snippets/python/s/map-dictionary.md @@ -5,6 +5,7 @@ language: python tags: [list,dictionary] excerpt: Maps the values of a list to a dictionary using a function. cover: colors-mural +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/map-values.md b/content/snippets/python/s/map-values.md index 6833255378c..cfdec9a264e 100644 --- a/content/snippets/python/s/map-values.md +++ b/content/snippets/python/s/map-values.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: pineapple-laptop +excerpt: Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/max-by.md b/content/snippets/python/s/max-by.md index 82e1766a95c..4f3dae1525b 100644 --- a/content/snippets/python/s/max-by.md +++ b/content/snippets/python/s/max-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: digital-nomad-3 +excerpt: Returns the maximum value of a list, after mapping each element to a value using the provided function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/max-element-index.md b/content/snippets/python/s/max-element-index.md index 6313834dd2c..4902f6a4947 100644 --- a/content/snippets/python/s/max-element-index.md +++ b/content/snippets/python/s/max-element-index.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: dark-cloud +excerpt: Returns the index of the element with the maximum value in a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/max-n.md b/content/snippets/python/s/max-n.md index e15eb9fcd66..65474e831b4 100644 --- a/content/snippets/python/s/max-n.md +++ b/content/snippets/python/s/max-n.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,math] cover: red-succulent +excerpt: Returns the `n` maximum elements from the provided list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/median.md b/content/snippets/python/s/median.md index 14464832636..f33ca1c4128 100644 --- a/content/snippets/python/s/median.md +++ b/content/snippets/python/s/median.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: little-bird +excerpt: Finds the median of a list of numbers. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/merge-dictionaries.md b/content/snippets/python/s/merge-dictionaries.md index eb8bb42f665..d4b0da44a2f 100644 --- a/content/snippets/python/s/merge-dictionaries.md +++ b/content/snippets/python/s/merge-dictionaries.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: plant-candle +excerpt: Merges two or more dictionaries. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/merge.md b/content/snippets/python/s/merge.md index 5571f4aea9c..f6dd518c303 100644 --- a/content/snippets/python/s/merge.md +++ b/content/snippets/python/s/merge.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-2 +excerpt: Merges two or more lists into a list of lists, combining elements from each of the input lists based on their positions. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/min-by.md b/content/snippets/python/s/min-by.md index a89061d1a25..5fdbe24f7a9 100644 --- a/content/snippets/python/s/min-by.md +++ b/content/snippets/python/s/min-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: purple-flower-field +excerpt: Returns the minimum value of a list, after mapping each element to a value using the provided function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/min-element-index.md b/content/snippets/python/s/min-element-index.md index 7917cf7aef8..871140e172f 100644 --- a/content/snippets/python/s/min-element-index.md +++ b/content/snippets/python/s/min-element-index.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: two-cities +excerpt: Returns the index of the element with the minimum value in a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/min-n.md b/content/snippets/python/s/min-n.md index e41a53b352b..89d969b1827 100644 --- a/content/snippets/python/s/min-n.md +++ b/content/snippets/python/s/min-n.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,math] cover: balloons +excerpt: Returns the `n` minimum elements from the provided list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/months-diff.md b/content/snippets/python/s/months-diff.md index 5b1d503ecc4..0c92f021950 100644 --- a/content/snippets/python/s/months-diff.md +++ b/content/snippets/python/s/months-diff.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: succulent-11 +excerpt: Calculates the month difference between two dates. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/most-frequent.md b/content/snippets/python/s/most-frequent.md index eef4fa96578..684107a6a04 100644 --- a/content/snippets/python/s/most-frequent.md +++ b/content/snippets/python/s/most-frequent.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: secret-tree +excerpt: Returns the most frequent element in a list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/mutable-default-arguments.md b/content/snippets/python/s/mutable-default-arguments.md index 0785ae2ef7d..bfee061a073 100644 --- a/content/snippets/python/s/mutable-default-arguments.md +++ b/content/snippets/python/s/mutable-default-arguments.md @@ -6,6 +6,7 @@ language: python tags: [function] cover: goat-wooden-cottage excerpt: Mutable default arguments can trip up Python beginners and veterans alike. Here's a quick workaround to deal with them. +listed: true dateModified: 2022-02-27 --- diff --git a/content/snippets/python/s/n-times-string.md b/content/snippets/python/s/n-times-string.md index be0e143371e..16feb2e8d40 100644 --- a/content/snippets/python/s/n-times-string.md +++ b/content/snippets/python/s/n-times-string.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: playing-fetch +excerpt: Generates a string with the given string value repeated `n` number of times. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/named-tuples.md b/content/snippets/python/s/named-tuples.md index 1cfed583bdd..1c18010185e 100644 --- a/content/snippets/python/s/named-tuples.md +++ b/content/snippets/python/s/named-tuples.md @@ -6,6 +6,7 @@ language: python tags: [list,dictionary] cover: mask-quiet excerpt: Understand Python's named tuples and start using them in your projects today. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/none.md b/content/snippets/python/s/none.md index a82dcf01c56..0962c75228a 100644 --- a/content/snippets/python/s/none.md +++ b/content/snippets/python/s/none.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: jars-on-shelf-2 +excerpt: Checks if the provided function returns `True` for at least one element in the list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/num-to-range.md b/content/snippets/python/s/num-to-range.md index 252be065c8c..8bc36e4d687 100644 --- a/content/snippets/python/s/num-to-range.md +++ b/content/snippets/python/s/num-to-range.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: round-leaves +excerpt: Maps a number from one range to another range. +listed: true dateModified: 2021-04-05 --- diff --git a/content/snippets/python/s/offset.md b/content/snippets/python/s/offset.md index d724b6048f1..fc5ae28580a 100644 --- a/content/snippets/python/s/offset.md +++ b/content/snippets/python/s/offset.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: digital-nomad-10 +excerpt: Moves the specified amount of elements to the end of the list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/pad-number.md b/content/snippets/python/s/pad-number.md index 50c0589b8b4..5340f1ec79d 100644 --- a/content/snippets/python/s/pad-number.md +++ b/content/snippets/python/s/pad-number.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,math] cover: umbrellas +excerpt: Pads a given number to the specified length. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/pad.md b/content/snippets/python/s/pad.md index 48bb4d0b0c9..086c809a927 100644 --- a/content/snippets/python/s/pad.md +++ b/content/snippets/python/s/pad.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: digital-nomad-11 +excerpt: Pads a string on both sides with the specified character, if it's shorter than the specified length. +listed: true dateModified: 2020-10-04 --- diff --git a/content/snippets/python/s/palindrome.md b/content/snippets/python/s/palindrome.md index 95a7e3db325..23eda2995f1 100644 --- a/content/snippets/python/s/palindrome.md +++ b/content/snippets/python/s/palindrome.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: succulent-6 +excerpt: Checks if the given string is a palindrome. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/pluck.md b/content/snippets/python/s/pluck.md index 1ec8bdf933f..5bf6b01cd14 100644 --- a/content/snippets/python/s/pluck.md +++ b/content/snippets/python/s/pluck.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,dictionary] cover: succulent-9 +excerpt: Converts a list of dictionaries into a list of values corresponding to the specified `key`. +listed: true dateModified: 2020-10-22 --- diff --git a/content/snippets/python/s/powerset.md b/content/snippets/python/s/powerset.md index 87b166c87cd..a480766c9a7 100644 --- a/content/snippets/python/s/powerset.md +++ b/content/snippets/python/s/powerset.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: rock-climbing +excerpt: Returns the powerset of a given iterable. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/prime-factors.md b/content/snippets/python/s/prime-factors.md index d15e29d3cde..361f62f99c8 100644 --- a/content/snippets/python/s/prime-factors.md +++ b/content/snippets/python/s/prime-factors.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,algorithm] cover: river-flow +excerpt: Finds and returns the list of prime factors of a number. +listed: true dateModified: 2023-05-24 --- diff --git a/content/snippets/python/s/reverse-number.md b/content/snippets/python/s/reverse-number.md index 428cef62c23..69376ff4088 100644 --- a/content/snippets/python/s/reverse-number.md +++ b/content/snippets/python/s/reverse-number.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: taking-photos +excerpt: Reverses a number. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/reverse.md b/content/snippets/python/s/reverse.md index ca5a0a9653d..3629fb51636 100644 --- a/content/snippets/python/s/reverse.md +++ b/content/snippets/python/s/reverse.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,string] cover: industrial-tokyo +excerpt: Reverses a list or a string. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/rgb-to-hex.md b/content/snippets/python/s/rgb-to-hex.md index 0ce54829a62..a6a6e022768 100644 --- a/content/snippets/python/s/rgb-to-hex.md +++ b/content/snippets/python/s/rgb-to-hex.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,math] cover: campfire +excerpt: Converts the values of RGB components to a hexadecimal color code. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/roll.md b/content/snippets/python/s/roll.md index a146aebaf38..258f4a39085 100644 --- a/content/snippets/python/s/roll.md +++ b/content/snippets/python/s/roll.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: colorful-pots +excerpt: Moves the specified amount of elements to the start of the list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/sample.md b/content/snippets/python/s/sample.md index ba2f2c3da93..f8fa72476e0 100644 --- a/content/snippets/python/s/sample.md +++ b/content/snippets/python/s/sample.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,random] cover: walking-on-top +excerpt: Returns a random element from a list. +listed: true dateModified: 2020-10-28 --- diff --git a/content/snippets/python/s/setup-python3-pip3-as-default.md b/content/snippets/python/s/setup-python3-pip3-as-default.md index 1e0b91ef867..129fcb8d7fe 100644 --- a/content/snippets/python/s/setup-python3-pip3-as-default.md +++ b/content/snippets/python/s/setup-python3-pip3-as-default.md @@ -6,6 +6,7 @@ language: python tags: [setup] cover: avocado-slices excerpt: A very common problem when working with Python is having to remember the correct version. Luckily, there's an easy fix for that. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/shuffle.md b/content/snippets/python/s/shuffle.md index 09cba4174c9..e4ae17b69be 100644 --- a/content/snippets/python/s/shuffle.md +++ b/content/snippets/python/s/shuffle.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list,random] cover: tent-stars +excerpt: Randomizes the order of the values of an list, returning a new list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/similarity.md b/content/snippets/python/s/similarity.md index e1d58d3c71e..626af93c3ea 100644 --- a/content/snippets/python/s/similarity.md +++ b/content/snippets/python/s/similarity.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: sunflowers +excerpt: Returns a list of elements that exist in both lists. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/slice-assignment.md b/content/snippets/python/s/slice-assignment.md index 83b0b0a9068..b3e49647718 100644 --- a/content/snippets/python/s/slice-assignment.md +++ b/content/snippets/python/s/slice-assignment.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: sliced-fruits excerpt: Learn everything you need to know about Python's slice assignment with this handy guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/slice-notation.md b/content/snippets/python/s/slice-notation.md index 508fe494e77..e6698ecd4a5 100644 --- a/content/snippets/python/s/slice-notation.md +++ b/content/snippets/python/s/slice-notation.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: sliced-fruits excerpt: Learn everything you need to know about Python's slice notation with this handy guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/slugify.md b/content/snippets/python/s/slugify.md index b32035351a4..5936f80544d 100644 --- a/content/snippets/python/s/slugify.md +++ b/content/snippets/python/s/slugify.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,regexp] cover: sliced-fruits +excerpt: Converts a string to a URL-friendly slug. +listed: true dateModified: 2020-10-25 --- diff --git a/content/snippets/python/s/snake.md b/content/snippets/python/s/snake.md index fb10a140bd0..b0a70c0c7ed 100644 --- a/content/snippets/python/s/snake.md +++ b/content/snippets/python/s/snake.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,regexp] cover: lemon-tea +excerpt: Converts a string to snake case. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/some.md b/content/snippets/python/s/some.md index 04250ae351e..91003c39882 100644 --- a/content/snippets/python/s/some.md +++ b/content/snippets/python/s/some.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: leafy-screens +excerpt: Checks if the provided function returns `True` for at least one element in the list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/sort-by-indexes.md b/content/snippets/python/s/sort-by-indexes.md index 35db1022db0..b1f2748bfd6 100644 --- a/content/snippets/python/s/sort-by-indexes.md +++ b/content/snippets/python/s/sort-by-indexes.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: little-white-flowers +excerpt: Sorts one list based on another list containing the desired indexes. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/sort-dict-by-key.md b/content/snippets/python/s/sort-dict-by-key.md index e4099e38f0d..6b8c43bb312 100644 --- a/content/snippets/python/s/sort-dict-by-key.md +++ b/content/snippets/python/s/sort-dict-by-key.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: laptop-plants +excerpt: Sorts the given dictionary by key. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/sort-dict-by-value.md b/content/snippets/python/s/sort-dict-by-value.md index 105d106f441..825dd9cf973 100644 --- a/content/snippets/python/s/sort-dict-by-value.md +++ b/content/snippets/python/s/sort-dict-by-value.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary] cover: jars-on-shelf +excerpt: Sorts the given dictionary by value. +listed: true dateModified: 2021-01-08 --- diff --git a/content/snippets/python/s/sort-dictionary-tuple-key.md b/content/snippets/python/s/sort-dictionary-tuple-key.md index b043f09d2df..59801376c81 100644 --- a/content/snippets/python/s/sort-dictionary-tuple-key.md +++ b/content/snippets/python/s/sort-dictionary-tuple-key.md @@ -6,6 +6,7 @@ language: python tags: [list,dictionary] cover: matrix-flow excerpt: Learn how to sort a Python dictionary list using a tuple key. +listed: true dateModified: 2023-01-04 --- diff --git a/content/snippets/python/s/sortedlist-vs-list-sort.md b/content/snippets/python/s/sortedlist-vs-list-sort.md index 4216ed70915..de8914f0e68 100644 --- a/content/snippets/python/s/sortedlist-vs-list-sort.md +++ b/content/snippets/python/s/sortedlist-vs-list-sort.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: duck-plants excerpt: Learn the difference between Python's built-in list sorting methods and when one is preferred over the other. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/python/s/split-lines.md b/content/snippets/python/s/split-lines.md index 48d31df673e..04ff68ae063 100644 --- a/content/snippets/python/s/split-lines.md +++ b/content/snippets/python/s/split-lines.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string] cover: succulent-4 +excerpt: Splits a multiline string into a list of lines. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/spread.md b/content/snippets/python/s/spread.md index 7a326e2fb93..3eed4de8660 100644 --- a/content/snippets/python/s/spread.md +++ b/content/snippets/python/s/spread.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: digital-nomad-14 +excerpt: Flattens a list, by spreading its elements into a new list. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/string-is-empty.md b/content/snippets/python/s/string-is-empty.md index d65e574e652..9180d36e7d7 100644 --- a/content/snippets/python/s/string-is-empty.md +++ b/content/snippets/python/s/string-is-empty.md @@ -6,6 +6,7 @@ language: python tags: [string] cover: tea-laptop-table excerpt: Here are two quick and elegant ways to check if a string is empty in Python. +listed: true dateModified: 2022-08-05 --- diff --git a/content/snippets/python/s/strip-string-prefix.md b/content/snippets/python/s/strip-string-prefix.md index 0f8a5c24777..263561f8e70 100644 --- a/content/snippets/python/s/strip-string-prefix.md +++ b/content/snippets/python/s/strip-string-prefix.md @@ -6,6 +6,7 @@ language: python tags: [string] cover: cave-exploration excerpt: Using `str.lstrip()` to strip a prefix from a string might not be exactly what you're looking for. Here's what you should use instead. +listed: true dateModified: 2024-01-18 --- diff --git a/content/snippets/python/s/sum-by.md b/content/snippets/python/s/sum-by.md index 809f81d34ab..130e978bd7e 100644 --- a/content/snippets/python/s/sum-by.md +++ b/content/snippets/python/s/sum-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: horse-sunset +excerpt: Calculates the sum of a list, after mapping each element to a value using the provided function. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/sum-of-powers.md b/content/snippets/python/s/sum-of-powers.md index c698bd5ef2f..7173c0c6143 100644 --- a/content/snippets/python/s/sum-of-powers.md +++ b/content/snippets/python/s/sum-of-powers.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: river-flow +excerpt: Returns the sum of the powers of all the numbers from `start` to `end` (both inclusive). +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/swap-variables.md b/content/snippets/python/s/swap-variables.md index 353ca6a5560..c824693f3b5 100644 --- a/content/snippets/python/s/swap-variables.md +++ b/content/snippets/python/s/swap-variables.md @@ -6,6 +6,7 @@ language: python tags: [variables] cover: leaves-read excerpt: Learn 3 easy ways to swap the values of two variables in Python. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/python/s/symmetric-difference-by.md b/content/snippets/python/s/symmetric-difference-by.md index 49f9fe140d9..3ad0d08cb10 100644 --- a/content/snippets/python/s/symmetric-difference-by.md +++ b/content/snippets/python/s/symmetric-difference-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: succulent-1 +excerpt: Returns the symmetric difference between two lists, after applying the provided function to each list element of both. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/symmetric-difference.md b/content/snippets/python/s/symmetric-difference.md index 4be7c46bbb9..9b8652fc6ed 100644 --- a/content/snippets/python/s/symmetric-difference.md +++ b/content/snippets/python/s/symmetric-difference.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: ice +excerpt: Returns the symmetric difference between two iterables, without filtering out duplicate values. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/tail.md b/content/snippets/python/s/tail.md index e3cb1ebbfa4..405c2e7c576 100644 --- a/content/snippets/python/s/tail.md +++ b/content/snippets/python/s/tail.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: meteora +excerpt: Returns all elements in a list except for the first one. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/take-right.md b/content/snippets/python/s/take-right.md index 5a0abcb2cc1..b0e615f62c0 100644 --- a/content/snippets/python/s/take-right.md +++ b/content/snippets/python/s/take-right.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: three-vases +excerpt: Returns a list with `n` elements removed from the end. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/take.md b/content/snippets/python/s/take.md index c67834df084..ae99d9806ba 100644 --- a/content/snippets/python/s/take.md +++ b/content/snippets/python/s/take.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: sea-view-2 +excerpt: Returns a list with `n` elements removed from the beginning. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/to-binary.md b/content/snippets/python/s/to-binary.md index 95f9ca7847a..82920e6bf37 100644 --- a/content/snippets/python/s/to-binary.md +++ b/content/snippets/python/s/to-binary.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: digital-nomad-13 +excerpt: Returns the binary representation of the given number. +listed: true dateModified: 2020-10-07 --- diff --git a/content/snippets/python/s/to-dictionary.md b/content/snippets/python/s/to-dictionary.md index b4f7424f55e..5017a150569 100644 --- a/content/snippets/python/s/to-dictionary.md +++ b/content/snippets/python/s/to-dictionary.md @@ -5,6 +5,7 @@ language: python tags: [list,dictionary] excerpt: Combines two lists into a dictionary, using the first one as the keys and the second one as the values. cover: purple-sunset +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/to-hex.md b/content/snippets/python/s/to-hex.md index a8b80f39575..f4189b2c4b5 100644 --- a/content/snippets/python/s/to-hex.md +++ b/content/snippets/python/s/to-hex.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math] cover: beach-overview +excerpt: Returns the hexadecimal representation of the given number. +listed: true dateModified: 2020-10-09 --- diff --git a/content/snippets/python/s/to-iso-date.md b/content/snippets/python/s/to-iso-date.md index 7cbc845221a..424ded98d86 100644 --- a/content/snippets/python/s/to-iso-date.md +++ b/content/snippets/python/s/to-iso-date.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [date] cover: succulent-red-light +excerpt: Converts a date to its ISO-8601 representation. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/python/s/to-roman-numeral.md b/content/snippets/python/s/to-roman-numeral.md index 05268f2d783..eb943a467d2 100644 --- a/content/snippets/python/s/to-roman-numeral.md +++ b/content/snippets/python/s/to-roman-numeral.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,string] cover: tram-car +excerpt: Converts an integer to its roman numeral representation. Accepts value between `1` and `3999` (both inclusive). +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/transpose.md b/content/snippets/python/s/transpose.md index d159660ba68..05cf8600b48 100644 --- a/content/snippets/python/s/transpose.md +++ b/content/snippets/python/s/transpose.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: lake-bench +excerpt: Transposes a two-dimensional list. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/trim-whitespace.md b/content/snippets/python/s/trim-whitespace.md index 2214db57cc7..784febce208 100644 --- a/content/snippets/python/s/trim-whitespace.md +++ b/content/snippets/python/s/trim-whitespace.md @@ -6,6 +6,7 @@ language: python tags: [string] cover: organizer excerpt: Oftentimes you might need to trim whitespace from a string in Python. Learn of three different way to do this in this short guide. +listed: true dateModified: 2021-12-13 --- diff --git a/content/snippets/python/s/unfold.md b/content/snippets/python/s/unfold.md index c9bd0f7f48d..a908ef77d3d 100644 --- a/content/snippets/python/s/unfold.md +++ b/content/snippets/python/s/unfold.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function,list] cover: painters-desk +excerpt: Builds a list, using an iterator function and an initial seed value. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/union-by.md b/content/snippets/python/s/union-by.md index 37d7d9391af..dc84a63d7d9 100644 --- a/content/snippets/python/s/union-by.md +++ b/content/snippets/python/s/union-by.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: sunrise-over-city +excerpt: Returns every element that exists in any of the two lists once, after applying the provided function to each element of both. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/union.md b/content/snippets/python/s/union.md index 62a33d48434..c94ed3b0857 100644 --- a/content/snippets/python/s/union.md +++ b/content/snippets/python/s/union.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: river-houses +excerpt: Returns every element that exists in any of the two lists once. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/unique-elements.md b/content/snippets/python/s/unique-elements.md index 4140d961a45..c14515ec914 100644 --- a/content/snippets/python/s/unique-elements.md +++ b/content/snippets/python/s/unique-elements.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [list] cover: cold-mountains +excerpt: Returns the unique elements in a given list. +listed: true dateModified: 2020-09-15 --- diff --git a/content/snippets/python/s/values-only.md b/content/snippets/python/s/values-only.md index a078ed7eeef..9ef7a51fafc 100644 --- a/content/snippets/python/s/values-only.md +++ b/content/snippets/python/s/values-only.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [dictionary,list] cover: colorful-lounge +excerpt: Returns a flat list of all the values in a flat dictionary. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/s/weighted-average.md b/content/snippets/python/s/weighted-average.md index 3e99e63c5c5..c7312d29161 100644 --- a/content/snippets/python/s/weighted-average.md +++ b/content/snippets/python/s/weighted-average.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [math,list] cover: digital-nomad-4 +excerpt: Returns the weighted average of two or more numbers. +listed: true dateModified: 2020-12-24 --- diff --git a/content/snippets/python/s/what-does-if-name-main-do.md b/content/snippets/python/s/what-does-if-name-main-do.md index a221cf043a3..c16fcd45ba1 100644 --- a/content/snippets/python/s/what-does-if-name-main-do.md +++ b/content/snippets/python/s/what-does-if-name-main-do.md @@ -6,6 +6,7 @@ language: python tags: [function] cover: stairs-from-below excerpt: Understand what one of the most commonly used Python constructs does and when you should use it. +listed: true dateModified: 2024-01-17 --- diff --git a/content/snippets/python/s/when.md b/content/snippets/python/s/when.md index 591de7cebbf..c4bddfd7a2e 100644 --- a/content/snippets/python/s/when.md +++ b/content/snippets/python/s/when.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [function] cover: interior-10 +excerpt: Tests a value, `x`, against a testing function, conditionally applying a function. +listed: true dateModified: 2020-11-09 --- diff --git a/content/snippets/python/s/words.md b/content/snippets/python/s/words.md index c8fc58b74ab..4901d419eb1 100644 --- a/content/snippets/python/s/words.md +++ b/content/snippets/python/s/words.md @@ -4,6 +4,8 @@ type: snippet language: python tags: [string,regexp] cover: rocky-lake +excerpt: Converts a given string into a list of words. +listed: true dateModified: 2020-11-02 --- diff --git a/content/snippets/python/snippet-template.md b/content/snippets/python/snippet-template.md index d123bd58044..252e4bfc16c 100644 --- a/content/snippets/python/snippet-template.md +++ b/content/snippets/python/snippet-template.md @@ -6,6 +6,7 @@ language: python tags: [list] cover: image excerpt: A short summary of your story up to 140 characters long. +listed: true dateModified: 2021-06-13 --- diff --git a/content/snippets/react/s/accordion.md b/content/snippets/react/s/accordion.md index cd98b6605aa..32f5351ee79 100644 --- a/content/snippets/react/s/accordion.md +++ b/content/snippets/react/s/accordion.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,children,state] cover: orange-wedges +excerpt: Renders an accordion menu with multiple collapsible content elements. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/alert.md b/content/snippets/react/s/alert.md index d5a34543c3a..7e577e87289 100644 --- a/content/snippets/react/s/alert.md +++ b/content/snippets/react/s/alert.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,state,effect] cover: flower-portrait-1 +excerpt: Renders an alert component with `type` prop. +listed: true dateModified: 2021-01-07 --- diff --git a/content/snippets/react/s/auto-link.md b/content/snippets/react/s/auto-link.md index bd7edbb5900..cb2b35c73b4 100644 --- a/content/snippets/react/s/auto-link.md +++ b/content/snippets/react/s/auto-link.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,fragment,regexp] cover: red-petals +excerpt: Renders a string as plaintext, with URLs converted to appropriate link elements. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/react/s/breaking-react.md b/content/snippets/react/s/breaking-react.md index 55057838b47..ec12ef3a38a 100644 --- a/content/snippets/react/s/breaking-react.md +++ b/content/snippets/react/s/breaking-react.md @@ -5,6 +5,7 @@ language: react tags: [debugging] cover: broken-screen excerpt: As powerful as React is, it is also quite fragile at places. Did you know that a few lines can easily break your entire React application? +listed: true dateModified: 2021-11-06 --- diff --git a/content/snippets/react/s/callto.md b/content/snippets/react/s/callto.md index 92e75cdf312..e7d0c0695ed 100644 --- a/content/snippets/react/s/callto.md +++ b/content/snippets/react/s/callto.md @@ -3,8 +3,9 @@ title: Callable telephone link type: snippet language: react tags: [components] -unlisted: true cover: rabbit-call +excerpt: Renders a link formatted to call a phone number (`tel:` link). +listed: false dateModified: 2021-01-04 --- diff --git a/content/snippets/react/s/carousel.md b/content/snippets/react/s/carousel.md index 5407150e608..5a149277e58 100644 --- a/content/snippets/react/s/carousel.md +++ b/content/snippets/react/s/carousel.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,children,state,effect] cover: shell-focus +excerpt: Renders a carousel component. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/react/s/collapse.md b/content/snippets/react/s/collapse.md index 9251d567b60..b7031043176 100644 --- a/content/snippets/react/s/collapse.md +++ b/content/snippets/react/s/collapse.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,children,state] cover: washed-ashore +excerpt: Renders a component with collapsible content. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/conditional-classname.md b/content/snippets/react/s/conditional-classname.md index 99182ae4528..78046a9bef7 100644 --- a/content/snippets/react/s/conditional-classname.md +++ b/content/snippets/react/s/conditional-classname.md @@ -6,6 +6,7 @@ language: react tags: [components] cover: succulent-red-light excerpt: In React components, you might need to conditionally apply a `className`. Learn how to handle empty values correctly using this handy tip. +listed: true dateModified: 2021-11-07 --- diff --git a/content/snippets/react/s/controlled-input.md b/content/snippets/react/s/controlled-input.md index 6feedd31bb4..6fb0fd71230 100644 --- a/content/snippets/react/s/controlled-input.md +++ b/content/snippets/react/s/controlled-input.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input] cover: digital-nomad-5 +excerpt: Renders a controlled `` element that uses a callback function to inform its parent about value updates. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/react/s/count-down.md b/content/snippets/react/s/count-down.md index 4e4bf3d241b..14286e4935c 100644 --- a/content/snippets/react/s/count-down.md +++ b/content/snippets/react/s/count-down.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,state] cover: sea-view-2 +excerpt: Renders a countdown timer that prints a message when it reaches zero. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/data-list.md b/content/snippets/react/s/data-list.md index 80d8e78cb55..6c7eb3d1068 100644 --- a/content/snippets/react/s/data-list.md +++ b/content/snippets/react/s/data-list.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components] cover: interior-14 +excerpt: Renders a list of elements from an array of primitives. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/react/s/data-table.md b/content/snippets/react/s/data-table.md index e0afbf052df..d3531652859 100644 --- a/content/snippets/react/s/data-table.md +++ b/content/snippets/react/s/data-table.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components] cover: armchair +excerpt: Renders a table with rows dynamically created from an array of primitives. +listed: true dateModified: 2020-11-03 --- diff --git a/content/snippets/react/s/file-drop.md b/content/snippets/react/s/file-drop.md index 3042570fccb..3e8d22eabb7 100644 --- a/content/snippets/react/s/file-drop.md +++ b/content/snippets/react/s/file-drop.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input,state,effect,event] cover: man-red-sunset +excerpt: Renders a file drag and drop component for a single file. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/lazy-load-image.md b/content/snippets/react/s/lazy-load-image.md index 7892cef60b8..1be7a20dab6 100644 --- a/content/snippets/react/s/lazy-load-image.md +++ b/content/snippets/react/s/lazy-load-image.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,effect,state] cover: strawberries +excerpt: Renders an image that supports lazy loading. +listed: true dateModified: 2022-07-29 --- diff --git a/content/snippets/react/s/limited-textarea.md b/content/snippets/react/s/limited-textarea.md index 533454aa610..be9f1ff7d08 100644 --- a/content/snippets/react/s/limited-textarea.md +++ b/content/snippets/react/s/limited-textarea.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,state,callback,event] cover: flower-portrait-2 +excerpt: Renders a textarea component with a character limit. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/limited-word-textarea.md b/content/snippets/react/s/limited-word-textarea.md index 8643bba08ae..c5175cee051 100644 --- a/content/snippets/react/s/limited-word-textarea.md +++ b/content/snippets/react/s/limited-word-textarea.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input,state,callback,effect,event] cover: painters-desk +excerpt: Renders a textarea component with a word limit. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/loader.md b/content/snippets/react/s/loader.md index 9a54d5f5bb5..4cb37ad609a 100644 --- a/content/snippets/react/s/loader.md +++ b/content/snippets/react/s/loader.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components] cover: godray-computer-mug +excerpt: Renders a spinning loader component. +listed: true dateModified: 2020-11-16 --- diff --git a/content/snippets/react/s/mailto.md b/content/snippets/react/s/mailto.md index e60eb16130e..790ffe4995d 100644 --- a/content/snippets/react/s/mailto.md +++ b/content/snippets/react/s/mailto.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components] cover: digital-nomad-4 +excerpt: Renders a link formatted to send an email (`mailto:` link). +listed: true dateModified: 2020-11-16 --- diff --git a/content/snippets/react/s/mapped-table.md b/content/snippets/react/s/mapped-table.md index f1a10ce2245..e71745be924 100644 --- a/content/snippets/react/s/mapped-table.md +++ b/content/snippets/react/s/mapped-table.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,array,object] cover: waves-from-above-2 +excerpt: Renders a table with rows dynamically created from an array of objects and a list of property names. +listed: true dateModified: 2020-09-06 --- diff --git a/content/snippets/react/s/modal.md b/content/snippets/react/s/modal.md index 4f071ee980b..e60114b50e9 100644 --- a/content/snippets/react/s/modal.md +++ b/content/snippets/react/s/modal.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,effect] cover: yellow-white-mug-2 +excerpt: Renders a Modal component, controllable through events. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/multiselect-checkbox.md b/content/snippets/react/s/multiselect-checkbox.md index 680d3f94315..83d3d0faa13 100644 --- a/content/snippets/react/s/multiselect-checkbox.md +++ b/content/snippets/react/s/multiselect-checkbox.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input,state,array] cover: violin +excerpt: Renders a checkbox list that uses a callback function to pass its selected value/values to the parent component. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/password-revealer.md b/content/snippets/react/s/password-revealer.md index e7c0ab3e911..585294167aa 100644 --- a/content/snippets/react/s/password-revealer.md +++ b/content/snippets/react/s/password-revealer.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input,state] cover: thread +excerpt: Renders a password input field with a reveal button. +listed: true dateModified: 2020-11-25 --- diff --git a/content/snippets/react/s/proptypes-objectof-vs-shape.md b/content/snippets/react/s/proptypes-objectof-vs-shape.md index ddf4b24321f..69b1f037580 100644 --- a/content/snippets/react/s/proptypes-objectof-vs-shape.md +++ b/content/snippets/react/s/proptypes-objectof-vs-shape.md @@ -6,6 +6,7 @@ language: react tags: [components,proptypes] cover: shapes excerpt: Learn the differences between `PropTypes.objectOf()` and `PropTypes.shape()` and where to use each one with this quick guide. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/react/s/redux-readable-reducers.md b/content/snippets/react/s/redux-readable-reducers.md index 39bd05c414f..df618335bb7 100644 --- a/content/snippets/react/s/redux-readable-reducers.md +++ b/content/snippets/react/s/redux-readable-reducers.md @@ -6,6 +6,7 @@ language: react tags: [logic] cover: beach-from-above excerpt: When working with stateful code, you can run into issues realted to complexity and readability. Oftentimes, they are easily fixable. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/react/s/rendering-basics.md b/content/snippets/react/s/rendering-basics.md index a4652ee274b..73318d456dd 100644 --- a/content/snippets/react/s/rendering-basics.md +++ b/content/snippets/react/s/rendering-basics.md @@ -5,6 +5,7 @@ language: react tags: [render] cover: comic-glasses excerpt: Take a deeper dive into React's rendering process and understand the basics behind the popular JavaScript framework. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/react/s/rendering-optimization.md b/content/snippets/react/s/rendering-optimization.md index dc1a6a1e372..cb3516c141b 100644 --- a/content/snippets/react/s/rendering-optimization.md +++ b/content/snippets/react/s/rendering-optimization.md @@ -5,6 +5,7 @@ language: react tags: [render] cover: comic-glasses excerpt: Take a deeper dive into React's rendering process and understand how to make small yet powerful tweaks to optimize performance. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/react/s/rendering-state.md b/content/snippets/react/s/rendering-state.md index 4bae6f5799e..f4f06591617 100644 --- a/content/snippets/react/s/rendering-state.md +++ b/content/snippets/react/s/rendering-state.md @@ -5,6 +5,7 @@ language: react tags: [render] cover: comic-glasses excerpt: Take a deeper dive into React's rendering process and understand the role of the Context API and Redux in it. +listed: true dateModified: 2021-06-12 --- diff --git a/content/snippets/react/s/ripple-button.md b/content/snippets/react/s/ripple-button.md index 7cc62d7048d..90ccf29a5a9 100644 --- a/content/snippets/react/s/ripple-button.md +++ b/content/snippets/react/s/ripple-button.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,state,effect] cover: mountain-lake-cottage +excerpt: Renders a button that animates a ripple effect when clicked. +listed: true dateModified: 2021-10-13 --- diff --git a/content/snippets/react/s/select.md b/content/snippets/react/s/select.md index 4d6b4c91f5c..7145deb829f 100644 --- a/content/snippets/react/s/select.md +++ b/content/snippets/react/s/select.md @@ -4,6 +4,8 @@ type: snippet language: react tags: [components,input] cover: down-the-stream +excerpt: Renders an uncontrolled `