Rogue Ninja Creative
banner
rogueninja.com
Rogue Ninja Creative
@rogueninja.com
Practical, precise, and ready to bring ideas to life! Sharing helpful insights to spark creativity and solve problems.

Web Development | Hosting & Maintenance | Digital & Print Design

🚀 Based in BC, working globally. 🌎

https://rogueninja.com
YouTube is giving a masterclass on bad UI design. Their new Android update overlays a video's title and metadata on the video's thumbnail, making things look messy and also very difficult to read—especially for those with vision impairment.

Come on, YouTube!

#BadDesign #YouTube #UI #UX
May 14, 2025 at 9:31 PM
Instead of entering these commands directly into the command line, add them as a function called `todos` to your shell config file (e.g., ~/.bashrc or ~/.zshrc). Then simply run `todos` in your terminal to generate the todos.rtf file in the current directory.

#CommandLine #CodeNewbie #CodeTips
January 9, 2025 at 8:48 PM
Even better, you can save grep output with colour and formatting to a Rich Text file (.rtf) with a 3-command process:

1. Create the file and add an RTF colour header.
2. Process the grep output and format it with file paths, line numbers, and content.
3. Close the .rtf file.

See image for commands
January 9, 2025 at 8:48 PM
But grep output can get a bit difficult to read. To fix this we can add some well-aligned columns and some colour!

grep -Erin 'to[- ]?do' * | while IFS=: read -r file line content; do printf "\033[1;34m%-40s\033[0m:\033[1;32m%-5s\033[0m:\033[1;37m%s\033[0m\n" "$file" "$line" "$content"; done
January 9, 2025 at 8:48 PM
For even more useful results we can include line numbers in our grep outputs by adding the `-n` flag:

grep -Erin 'to[- ]?do' *

Flags:
-n: Displays line numbers alongside matches.
January 9, 2025 at 8:48 PM
To limit searches to multiple specific file types, `use --include`:

grep -Eri 'to[- ]?do' --include=\*.{css,vue} *

This searches only .css and .vue files for matches.
January 9, 2025 at 8:48 PM
If you tend to be inconsistent like me 😭 you can add the `-i` flag to make your search case-insensitive and the `-E` flag to match different patterns:

`grep -Eri 'to[- ]?do' *`

Flags:
-E: Extended regex (matches TODO, to-do, or to do).
-r: Search recursively.
-i: Case-insensitive search.
January 9, 2025 at 8:48 PM
Instead of ignoring subdirectories in your search you can search recursively with the `-r` flag:

grep -r 'todo' *
January 9, 2025 at 8:48 PM
To search for text in all file types, remove the extension:

grep 'todo' *

But this will return errors for subdirectories (ex. "grep: assets: Is a directory").

To skip subdirectories, use the `-d skip` option:

grep -d skip 'todo' *
January 9, 2025 at 8:48 PM
grep is a fast command line tool for finding text. Unlike most IDE search, it works in any terminal, supports automation, and runs over SSH. Example:

`grep 'todo' *.vue`

This searches for 'todo' in all .vue files in the current directory.
January 9, 2025 at 8:48 PM
While the tree command has its uses, my go-to for listing files is ls and its versatile options. I often use -l for a detailed list, -a to reveal hidden files, -h for human-readable sizes, and -G for colour. Combine them like so: `ls -lahG`, and you should see something like this:
January 7, 2025 at 11:27 AM
Now, open example_tree.html in your browser to explore the tree as clickable links.

Run `tree --help` to see the full list of options available.

#CommandLine #CodeNewbie #CodingTips
January 7, 2025 at 8:35 AM
Need a quick way to view your folder structure from the command line? tree is a command-line tool that shows directories in a clear hierarchy. In this example, -L 3 limits the depth to 3 levels, and -I "node_modules|dist" excludes those folders from the output:

#CommandLine #CodeNewbie #CodingTips
January 7, 2025 at 7:52 AM
Nuxt 3 Runtime Config Insight 🚀

Hardcode dev secrets in runtimeConfig—Nuxt replaces them with production env vars automatically. Example: apiSecret: "devSecret" is replaced by NUXT_API_SECRET in production.

#Nuxt3 #WebDevTips #Coding
December 2, 2024 at 5:01 AM