1
0
mirror of https://github.com/jbranchaud/til synced 2026-03-03 22:48:45 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
jbranchaud
1517e1fb7a Add Check How Database Is Configured as a Rails TIL 2026-01-30 13:26:12 -06:00
jbranchaud
f56d93b49b Add Control Which Monitor App Switcher Appears On as a Mac TIL 2026-01-27 13:46:08 -06:00
3 changed files with 70 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/).
For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter).
_1732 TILs and counting..._ _1734 TILs and counting..._
See some of the other learning resources I work on: See some of the other learning resources I work on:
@@ -720,6 +720,7 @@ If you've learned something here, support my efforts writing daily TILs by
- [Capture Screenshot To Clipboard From CLI](mac/capture-screenshot-to-clipboard-from-cli.md) - [Capture Screenshot To Clipboard From CLI](mac/capture-screenshot-to-clipboard-from-cli.md)
- [Check Network Quality Stats From The Command Line](mac/check-network-quality-stats-from-the-command-line.md) - [Check Network Quality Stats From The Command Line](mac/check-network-quality-stats-from-the-command-line.md)
- [Clean Up Old Homebrew Files](mac/clean-up-old-homebrew-files.md) - [Clean Up Old Homebrew Files](mac/clean-up-old-homebrew-files.md)
- [Control Which Monitor App Switcher Appears On](mac/control-which-monitor-app-switcher-appears-on.md)
- [Convert An HEIC Image File To JPG](mac/convert-an-heic-image-file-to-jpg.md) - [Convert An HEIC Image File To JPG](mac/convert-an-heic-image-file-to-jpg.md)
- [Default Screenshot Location](mac/default-screenshot-location.md) - [Default Screenshot Location](mac/default-screenshot-location.md)
- [Detect How Long A User Has Been Idle](mac/detect-how-long-a-user-has-been-idle.md) - [Detect How Long A User Has Been Idle](mac/detect-how-long-a-user-has-been-idle.md)
@@ -1070,6 +1071,7 @@ If you've learned something here, support my efforts writing daily TILs by
- [Cast Common Boolean-Like Values To Booleans](rails/cast-common-boolean-like-values-to-booleans.md) - [Cast Common Boolean-Like Values To Booleans](rails/cast-common-boolean-like-values-to-booleans.md)
- [Change The Nullability Of A Column](rails/change-the-nullability-of-a-column.md) - [Change The Nullability Of A Column](rails/change-the-nullability-of-a-column.md)
- [Change The Time Zone Offset Of A DateTime Object](rails/change-the-time-zone-offset-of-a-datetime-object.md) - [Change The Time Zone Offset Of A DateTime Object](rails/change-the-time-zone-offset-of-a-datetime-object.md)
- [Check How Database Is Configured](rails/check-how-database-is-configured.md)
- [Check If ActiveRecord Update Fails](rails/check-if-activerecord-update-fails.md) - [Check If ActiveRecord Update Fails](rails/check-if-activerecord-update-fails.md)
- [Check If Any Records Have A Null Value](rails/check-if-any-records-have-a-null-value.md) - [Check If Any Records Have A Null Value](rails/check-if-any-records-have-a-null-value.md)
- [Check Specific Attributes On ActiveRecord Array](rails/check-specific-attributes-on-activerecord-array.md) - [Check Specific Attributes On ActiveRecord Array](rails/check-specific-attributes-on-activerecord-array.md)

View File

@@ -0,0 +1,21 @@
# Control Which Monitor App Switcher Appears On
For the most part when I hit `cmd+tab` (and `cmd+shift+tab`) to switch between
apps, the visual switcher UI (which shows a row of the open apps) appears on my
main monitor. However, sometimes I will be hitting `cmd+tab` and nothing shows
up on my main monitor. I look to the right at my side monitor and there is the
app switcher UI.
Why is it appearing over there all of a sudden?
The reason is that the app switcher UI is anchored to the same screen where the
doc is located. Though the doc defaults to my main monitor, if I access the doc
from the side monitor, now it is anchored there.
To switch it back, I just have to make the doc slide up on my main monitor by
running my mouse down to the bottom of that screen.
The switch up was because I accidentally accessed the doc on my side monitor
without realizing.
[source](https://superuser.com/a/744680)

View File

@@ -0,0 +1,46 @@
# Check How Database Is Configured
While making some adjustments to the database connection string (`DATABASE_URL`)
for a pre-production Rails environment, we wanted to check that configuration
options like `sslmode` were picked up.
From a `rails console` session I can check the live database configuration like
so:
```ruby
> ActiveRecord::Base.connection_db_config.configuration_hash
=> {
adapter: "postgresql",
encoding: "unicode",
pool: 5,
database: "my_app_development"
}
```
I can look at the
[`configuration_hash`](https://api.rubyonrails.org/classes/ActiveRecord/DatabaseConfigurations/HashConfig.html#attribute-i-configuration_hash)
from `rails console` of my pre-prod environment to see more configuration
settings:
```ruby
> ActiveRecord::Base.connection_db_config.configuration_hash
=> {
adapter: "postgresql",
encoding: "unicode",
pool: 5,
username: "app_user",
password: "super_s3cr3t",
port: 15432,
database: "pre_prod_database",
host: "some-host-123.ondigitalocean.com",
sslmode: "verify-full"
}
```
Since I was specifically looking for the `sslmode` value, I can access that
directly:
```ruby
> ActiveRecord::Base.connection_db_config.configuration_hash[:sslmode]
=> "verify-full"
```