Skip to content

Commit

Permalink
deploy: 65fbffa
Browse files Browse the repository at this point in the history
  • Loading branch information
dvogt23 committed Nov 5, 2024
1 parent 5492f72 commit 54b9b3d
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 6 deletions.
3 changes: 2 additions & 1 deletion personal/home/furniture.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ <h2 id="art"><a class="header" href="#art">Art</a></h2>
<ul>
<li><a href="https://inzpero.de/">Inzpero</a></li>
<li><a href="https://artlistic.com">ARTlistic</a></li>
<li><a href="postera.art">postera.art</a></li>
</ul>
<h2 id="roof"><a class="header" href="#roof">Roof</a></h2>
<ul>
Expand All @@ -503,7 +504,7 @@ <h2 id="outdoor"><a class="header" href="#outdoor">Outdoor</a></h2>
<ul>
<li><a href="https://www.wpc-profi.com">WPC trace</a></li>
</ul>
<footer id="last-change">Last change: 2024-05-03, commit: <a href="https://github.com/dvogt23/notes/commit/e14fc23">e14fc23</a></footer>
<footer id="last-change">Last change: 2024-11-05, commit: <a href="https://github.com/dvogt23/notes/commit/65fbffa">65fbffa</a></footer>
</main>

<nav class="nav-wrapper" aria-label="Page navigation">
Expand Down
51 changes: 49 additions & 2 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -5563,6 +5563,52 @@ <h3 id="pattern-matching"><a class="header" href="#pattern-matching">Pattern mat
end
</code></pre>
<p>Source: <a href="https://fly.io/ruby-dispatch/pattern-matching-on-ruby-objects/">fly.io</a></p>
<h3 id="colorize-logger"><a class="header" href="#colorize-logger">Colorize logger</a></h3>
<pre><code class="language-ruby">module ColorizedLogger
COLOR_CODES = {
debug: "\e[36m", # Cyan
info: "\e[32m", # Green
warn: "\e[33m", # Yellow
error: "\e[31m", # Red
fatal: "\e[35m", # Magenta
unknown: "\e[37m" # White (or terminal default)
}.freeze

RESET = "\e[0m"

def debug(progname = nil, &amp;block)
super(colorize(:debug, progname, &amp;block))
end

def info(progname = nil, &amp;block)
super(colorize(:info, progname, &amp;block))
end

def warn(progname = nil, &amp;block)
super(colorize(:warn, progname, &amp;block))
end

def error(progname = nil, &amp;block)
super(colorize(:error, progname, &amp;block))
end

def fatal(progname = nil, &amp;block)
super(colorize(:fatal, progname, &amp;block))
end

def unknown(progname = nil, &amp;block)
super(colorize(:unknown, progname, &amp;block))
end

private

def colorize(level, message, &amp;block)
"#{COLOR_CODES[level]}#{message || (block &amp;&amp; block.call)}#{RESET}"
end
end

Rails.logger.extend(ColorizedLogger)
</code></pre>
<h3 id="test-coverage-pre-commit-hook"><a class="header" href="#test-coverage-pre-commit-hook">Test coverage pre-commit hook</a></h3>
<p>To get an positive exit code for pre-commit hook integration you have to add this to your spec config:</p>
<pre><code class="language-ruby"># spec/spec_helper.rb
Expand Down Expand Up @@ -6340,7 +6386,7 @@ <h3 id="database"><a class="header" href="#database">Database</a></h3>
has_many :recipe_ingredients
has_many :recipes, through: :recipe_ingredients
</code></pre>
<footer id="last-change">Last change: 2024-10-29, commit: <a href="https://github.com/dvogt23/notes/commit/bf12e84">bf12e84</a></footer><div style="break-before: page; page-break-before: always;"></div><style>
<footer id="last-change">Last change: 2024-11-05, commit: <a href="https://github.com/dvogt23/notes/commit/65fbffa">65fbffa</a></footer><div style="break-before: page; page-break-before: always;"></div><style>
.mdbook-callouts {
padding: 8px 16px;
margin-bottom: 16px;
Expand Down Expand Up @@ -14877,6 +14923,7 @@ <h2 id="art"><a class="header" href="#art">Art</a></h2>
<ul>
<li><a href="https://inzpero.de/">Inzpero</a></li>
<li><a href="https://artlistic.com">ARTlistic</a></li>
<li><a href="personal/home/postera.art">postera.art</a></li>
</ul>
<h2 id="roof"><a class="header" href="#roof">Roof</a></h2>
<ul>
Expand All @@ -14890,7 +14937,7 @@ <h2 id="outdoor"><a class="header" href="#outdoor">Outdoor</a></h2>
<ul>
<li><a href="https://www.wpc-profi.com">WPC trace</a></li>
</ul>
<footer id="last-change">Last change: 2024-05-03, commit: <a href="https://github.com/dvogt23/notes/commit/e14fc23">e14fc23</a></footer><div style="break-before: page; page-break-before: always;"></div><style>
<footer id="last-change">Last change: 2024-11-05, commit: <a href="https://github.com/dvogt23/notes/commit/65fbffa">65fbffa</a></footer><div style="break-before: page; page-break-before: always;"></div><style>
.mdbook-callouts {
padding: 8px 16px;
margin-bottom: 16px;
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

48 changes: 47 additions & 1 deletion tech/coding/rails.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,52 @@ <h3 id="pattern-matching"><a class="header" href="#pattern-matching">Pattern mat
end
</code></pre>
<p>Source: <a href="https://fly.io/ruby-dispatch/pattern-matching-on-ruby-objects/">fly.io</a></p>
<h3 id="colorize-logger"><a class="header" href="#colorize-logger">Colorize logger</a></h3>
<pre><code class="language-ruby">module ColorizedLogger
COLOR_CODES = {
debug: "\e[36m", # Cyan
info: "\e[32m", # Green
warn: "\e[33m", # Yellow
error: "\e[31m", # Red
fatal: "\e[35m", # Magenta
unknown: "\e[37m" # White (or terminal default)
}.freeze

RESET = "\e[0m"

def debug(progname = nil, &amp;block)
super(colorize(:debug, progname, &amp;block))
end

def info(progname = nil, &amp;block)
super(colorize(:info, progname, &amp;block))
end

def warn(progname = nil, &amp;block)
super(colorize(:warn, progname, &amp;block))
end

def error(progname = nil, &amp;block)
super(colorize(:error, progname, &amp;block))
end

def fatal(progname = nil, &amp;block)
super(colorize(:fatal, progname, &amp;block))
end

def unknown(progname = nil, &amp;block)
super(colorize(:unknown, progname, &amp;block))
end

private

def colorize(level, message, &amp;block)
"#{COLOR_CODES[level]}#{message || (block &amp;&amp; block.call)}#{RESET}"
end
end

Rails.logger.extend(ColorizedLogger)
</code></pre>
<h3 id="test-coverage-pre-commit-hook"><a class="header" href="#test-coverage-pre-commit-hook">Test coverage pre-commit hook</a></h3>
<p>To get an positive exit code for pre-commit hook integration you have to add this to your spec config:</p>
<pre><code class="language-ruby"># spec/spec_helper.rb
Expand Down Expand Up @@ -1260,7 +1306,7 @@ <h3 id="database"><a class="header" href="#database">Database</a></h3>
has_many :recipe_ingredients
has_many :recipes, through: :recipe_ingredients
</code></pre>
<footer id="last-change">Last change: 2024-10-29, commit: <a href="https://github.com/dvogt23/notes/commit/bf12e84">bf12e84</a></footer>
<footer id="last-change">Last change: 2024-11-05, commit: <a href="https://github.com/dvogt23/notes/commit/65fbffa">65fbffa</a></footer>
</main>

<nav class="nav-wrapper" aria-label="Page navigation">
Expand Down

0 comments on commit 54b9b3d

Please sign in to comment.