This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @EnableConfigurationProperties(AppSettings.class) | |
@ConfigurationPropertiesScan | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://github.com/charmbracelet/gum | |
# More examples: https://github.com/charmbracelet/gum/tree/main/examples | |
gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert" | |
# Input with placeholder | |
gum input --placeholder "Summary of this change" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://regexp.dev | |
import { createRegExp, exactly, oneOrMore, digit, char } from 'magic-regexp' | |
// hover to see the compiled regexp | |
const semver = createRegExp( | |
oneOrMore(digit) | |
.groupedAs('major') | |
.and('.') | |
.and(oneOrMore(digit).groupedAs('minor')) | |
.and(exactly('.').and(oneOrMore(char).groupedAs('patch')).optionally()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
class Validations: | |
def __setattr__(self, prop, val): | |
if (validator := getattr(self, f"validate_{prop}", None)): | |
object.__setattr__(self, prop, validator(val) or val) | |
else: | |
super().__setattr__(prop, val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# An example hook script to check the commit log message. | |
# Called by "git commit" with one argument, the name of the file | |
# that has the commit message. The hook should exit with non-zero | |
# status after issuing an appropriate message if it wants to stop the | |
# commit. The hook is allowed to edit the commit message file. | |
# | |
# To enable this hook, rename this file to "commit-msg". | |
# Uncomment the below to add a Signed-off-by line to the message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.inditex.mecretcond.infra.actuator; | |
import static java.time.Instant.now; | |
import static java.util.stream.Collectors.toList; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.charset.StandardCharsets; | |
import java.time.Duration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '(NR==1) {for (i=1;i<=NF;i++) print i ": " $i}' <data.csv | |
# 1: date | |
# 2: time | |
# 3: x-edge-location | |
# 4: sc-bytes | |
# 5: c-ip | |
# 6: cs-method | |
# 7: cs(Host) | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SDKMAN_DIR="/usr/local/sdkman" | |
# https://mharrison.org/post/bashfunctionoverride/ | |
copy_function() { | |
local orig_fn=$(declare -f $1) | |
local new_fn="$2${orig_fn#$1}" | |
eval "$new_fn" | |
} | |
sdk_fuzzy_find_local_version() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data.csv: | |
# | |
# Año,Marca,Modelo,Descripción,Precio | |
# 1997,Ford,E350,"ac, abs, moon",3000.00 | |
# 1999,Chevyr,Venture,Extended Edition,4900.00 | |
# 1999,Chevy,Venture,"Extended Edition, Very Large",5000.00 | |
# 1996,Jeep,Grand Cherokee,"MUST SELL! air, moon roof, loaded",4799.00 | |
awk -F, 'NR==2,NR==5 {print $2 " " $3}' <data.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# git-change | |
# | |
# Git helper script that lists remote branches sorted by their last update time. The branch list is fed | |
# into a fuzzy finder for interactive filtering and the selected branch is checked out. Finally a | |
# keyboard shortcut enables dynamic reloading of the branches after fetching the remote. | |
# External dependencies: | |
# - fzf: brew install fzf |
NewerOlder