In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
name: CI | |
on: push | |
jobs: | |
brakeman: | |
name: Brakeman | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: |
frozen_string_literal: true | |
# A leaky bucket rate limiter for Ruby | |
# | |
# @see https://www.mikeperham.com/2020/11/09/the-leaky-bucket-rate-limiter/ | |
# @see https://en.wikipedia.org/wiki/Leaky_bucket | |
class RateLimit | |
class Error < StandardError | |
attr_accessor :retry_in |
--- | |
include: | |
- ".solargraph_definitions.rb" | |
- "app/**/*.rb" | |
- "config/**/*.rb" | |
- "lib/**/*.rb" | |
exclude: | |
- test/**/* | |
- vendor/**/* | |
- ".bundle/**/*" |
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
# frozen_string_literal: true | |
require 'benchmark' | |
require 'benchmark/ips' | |
require 'benchmark/memory' | |
require 'csv' | |
N_NUMBER_OF = 100_000 | |
ary = Array.new(N_NUMBER_OF) { ['one', 'two', 'three', 'four', 'five', 'six'] } |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# This program modifies the original output of git-churn program https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn. | |
# It highlights current project files in green colour. | |
unless Kernel.system('command -v git-churn &> /dev/null') | |
STDOUT.puts("Install git-churn first. See details at https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn") | |
Kernel.exit | |
end |
SLACK_TEXT_START: 'Pipeline <$CI_PIPELINE_URL|$CI_PIPELINE_ID> _has started_ *$CI_PIPELINE_SOURCE* job <$CI_JOB_URL|$CI_JOB_ID> on *$ENVIRONMENT* _at branch_ *<$CI_PROJECT_URL/commit/$CI_COMMIT_SHA|$CI_COMMIT_REF_NAME>*' | |
SLACK_TEXT_FINISH: 'Pipeline <$CI_PIPELINE_URL|$CI_PIPELINE_ID> _has finished_ *$CI_PIPELINE_SOURCE* job <$CI_JOB_URL|$CI_JOB_ID> on *$ENVIRONMENT* _at branch_ *<$CI_PROJECT_URL/commit/$CI_COMMIT_SHA|$CI_COMMIT_REF_NAME>* _and generated_ *<$ALLURE_DIR|Allure Reports>*' | |
##################################### | |
# Custom Slack POST-message report # | |
##################################### | |
slack_notification: | |
script: | |
- > | |
curl |
:root { | |
--violation-color: red; /* used for clear issues */ | |
--warning-color: orange; /* used for potential issues we should look into */ | |
} | |
/* IMAGES */ | |
/* | |
* Lazy-Loaded Images Check | |
* ==== |
"=== Memory when using `try` ===" | |
Total allocated: 40 bytes (1 objects) | |
Total retained: 0 bytes (0 objects) | |
allocated memory by gem | |
----------------------------------- | |
40 other | |
allocated memory by file | |
----------------------------------- |