This file contains hidden or 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
| /* eslint-disable @typescript-eslint/no-explicit-any */ | |
| /** biome-ignore-all lint/suspicious/noExplicitAny: <> */ | |
| /** | |
| * Aguarda um tempo em milissegundos. | |
| * @param ms - Quantidade de milissegundos para aguardar. | |
| */ | |
| export function delay(ms: number): Promise<void> { | |
| return new Promise((resolve) => setTimeout(resolve, ms)); | |
| } |
This file contains hidden or 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 | |
| # Interrompe o script se ocorrer algum erro | |
| set -e | |
| # Verifica se jq está instalado | |
| if ! command -v jq &> /dev/null; then | |
| echo "Erro: 'jq' não está instalado. Instale com: https://jqlang.github.io/jq/" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| const makeDate = (year: number, month: number, day: number) => | |
| new Date(year, month, day, 0, 0, 0) | |
| const makeRangeBetweenDates = (start: Date, end: Date) => { | |
| const range: Date[] = [] | |
| for ( | |
| const i = new Date(start); | |
| i.getTime() <= end.getTime(); | |
| i.setDate(i.getDate() + 1) |
This file contains hidden or 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
| require 'csv' | |
| class CSVBuilder | |
| def initialize | |
| @columns = [] | |
| @data = [] | |
| end | |
| def add_column(column_name) | |
| @columns << column_name |
This file contains hidden or 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
| class ElapsedTime | |
| def elapsed | |
| start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
| yield if block_given? | |
| end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
| elapsed_time = "%.2f" % (end_time - start_time) | |
| puts "Tempo decorrido: #{elapsed_time} segundos" |
This file contains hidden or 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 ruby:3.2.2-alpine | |
| LABEL maintainer="Fulano de Tal <[email protected]>" | |
| RUN apk update && apk add --virtual build-dependencies build-base | |
| RUN apk add \ | |
| less \ | |
| mailcap \ | |
| sqlite-dev \ | |
| tzdata |
This file contains hidden or 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
| def text_to_fuzzy_search(text) | |
| first_word, *rest_words = text.split | |
| rest_words_chars = rest_words.map { _1.split('') } | |
| search = first_word.dup | |
| array = [search] | |
| rest_words_chars.each do |chars| | |
| search += " " |
This file contains hidden or 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
| import { faCheck, faTimes, faWarning } from '@fortawesome/free-solid-svg-icons'; | |
| import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | |
| import { | |
| Box, | |
| Button, | |
| Dialog, | |
| DialogActions, | |
| DialogContent, | |
| DialogTitle, | |
| Backdrop, |
This file contains hidden or 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
| const fetchAllResources = async (resources, params) => { | |
| const asyncIterable = { | |
| [Symbol.asyncIterator]() { | |
| return { | |
| page: '1', | |
| finished: false, | |
| async next() { | |
| if (!this.finished) { | |
| const response = await api.get(resources, { | |
| params: { ...params, page: this.page }, |
This file contains hidden or 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
| set -x GITLAB_PERSONAL_ACCESS_TOKEN abc | |
| set -x ATHENAS_API_TOKEN abc | |
| set -x SOLAR_API_TOKEN abc | |
| set -x JQ_ATHENAS '.results[0] | { field1, field2, field3, field4: field4.subfield1.name }' | |
| # go lang | |
| fish_add_path /usr/local/go/bin | |
| # flutter |
NewerOlder