In the terminal you can quickly parse/manipulate/transform data.
The Linux terminal has tons of awesome tools to make your life easier. Specially when you need to handle a big amount of data and/or files.
Recommended resource:
| #!/usr/bin/env bash | |
| # medals.sh | |
| ########### | |
| # Show the Olympics 2024 medal table. | |
| # | |
| # Data from <https://olympics.com/en/paris-2024/medals> | |
| # | |
| # Dependencies: | |
| # - curl | |
| # - jq |
| -- inspired by the code here: | |
| -- https://www.justinrassier.com/blog/posts/2024-04-17-how-to-make-a-code-snapshot-plugin-in-neovim | |
| vim.api.nvim_create_user_command("Freeze", function() | |
| -- get file type from the buffer | |
| local file_type = vim.bo.filetype | |
| -- get the text from the visual selection as a table | |
| local text = vim.fn.getline(vim.fn.getpos("'<")[2], vim.fn.getpos("'>")[2]) |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Hide/show elements / Pure CSS</title> | |
| <style> | |
| .contents, | |
| .hide-link, |
| # ... muito conteúdo foi omitido aqui... | |
| .template-maintainers-only: | |
| before_script: | |
| - source ./scripts/lib.sh | |
| - maintainersOnly | |
| # ... | |
| critical_job: | |
| extends: .template-maintainers-only |
In the terminal you can quickly parse/manipulate/transform data.
The Linux terminal has tons of awesome tools to make your life easier. Specially when you need to handle a big amount of data and/or files.
Recommended resource:
| #!/usr/bin/env bash | |
| # dg-publish.sh | |
| ################### | |
| # | |
| # This script adds a "dg-publish: true" to all *.md files that don't have | |
| # a "dg-publish: " defined in it's frontmatter. | |
| # | |
| # Consequences of this: | |
| # - non versioned files won't be affected (e.g.: gitignored files) | |
| # - files without any frontmatter will have one with "dg-publish: true" |
| #!/bin/bash | |
| # emojifix.sh | |
| ############# | |
| # Created to fix emojis in filenames in the "Obsidian Flight School" | |
| # https://www.linkingyourthinking.com/obsidian-flight-school | |
| # | |
| # Depends on 'rename' command (sudo apt install rename). | |
| # | |
| # meleu - February/2022 |
| #!/usr/bin/env bash | |
| # limbo-k8s-components.sh | |
| ######################### | |
| # | |
| # Usage: | |
| # ./limbo-k8s-components.sh [namespace] | |
| # | |
| # This script assumes all Deployment.spec.template.labels have an "app" label | |
| # AND all Service.spec.selector are selecting an "app" label. | |
| # |
| # 0x0(): Upload file or URL shortener. See more info at https://0x0.st/ | |
| 0x0() { | |
| local arg="$1" | |
| local curlArg | |
| if [[ -f "${arg}" ]]; then | |
| curlArg="file=@${arg}" | |
| elif [[ ${arg} =~ ^https?://.* ]]; then | |
| curlArg="shorten=${arg}" | |
| else |