Skip to content

Instantly share code, notes, and snippets.

View meleu's full-sized avatar
👨‍💻
Coding...

meleu meleu

👨‍💻
Coding...
View GitHub Profile
@meleu
meleu / index.html
Last active August 11, 2023 14:19
Mostrar/Esconder elementos HTML usando CSS puro
<!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,
@meleu
meleu / .gitlab-ci.yml
Created June 3, 2022 16:46
[GitLab CI] Apenas Maintainers podem rodar o job
# ... muito conteúdo foi omitido aqui...
.template-maintainers-only:
before_script:
- source ./scripts/lib.sh
- maintainersOnly
# ...
critical_job:
extends: .template-maintainers-only
@meleu
meleu / 5-devops-tips.md
Created April 26, 2022 20:16
5 DevOps tips to speed up your workflow

5 DevOps tips to speed up your workflow

1. Learn to live in the terminal.

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:

@meleu
meleu / manage-dotfiles.md
Created April 11, 2022 18:02
Smarttest way to manage dotfiles

smarttest way to manage your dotfiles with git

disclaimer

I'm assuming you have knowledge about git.

starting a dotfiles repo

@meleu
meleu / dg-publish.sh
Created April 5, 2022 16:42
dg-publish.sh
#!/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"
@meleu
meleu / emojifix.sh
Created March 10, 2022 21:44
Fix emojis in filenames in the "Obsidian Flight School"
#!/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
@meleu
meleu / limbo-k8s-components.sh
Last active December 9, 2021 21:38
List possible k8s Deployments and Services in the limbo.
#!/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.
#
@meleu
meleu / 0x0
Last active September 22, 2021 17:33
upload a file to 0x0 (give an URL as argument and it acts as an URL shortener)
# 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
@meleu
meleu / sync.sh
Created September 3, 2021 23:46
script criado para sincronizar com o repositório remoto
#!/usr/bin/env bash
# BUG: se por um acaso o script não concluir o push com sucesso, a próxima
# execução não fará o push (git status não vai pegar mudança alguma).
main() {
gitStatus="$(git status --porcelain)"
[[ -z "${gitStatus}" ]] && return 0
git add --all \
@meleu
meleu / banner.sh
Created July 23, 2021 18:32
shell script "banner"
#!/usr/bin/env bash
# banner():
# Imprime uma mensagem no seguinte formato:
# ============
# olá mundo!
# ============
banner() {
local string="$@"
local length="${#string}"