Skip to content

Instantly share code, notes, and snippets.

View DIEGOHORVATTI's full-sized avatar
💬
Advancing by leaps and bounds

DIEGOHORVATTI

💬
Advancing by leaps and bounds
  • Planet Earth, Brazil, Santa Catarina, Florianópolis
  • 05:39 (UTC -12:00)
  • LinkedIn in/diego-horvatti
  • Instagram diegohorvatti
View GitHub Profile
import { Elysia, t as Type } from 'elysia'
import cors from '@elysiajs/cors'
import { openApi } from '@/middlewares/open-api'
import { rateLimit } from '@/middlewares/rate-limit'
import { MongoClient, Db, Collection, Document, Filter, ObjectId } from 'mongodb'
import { NODE_ENV, version } from '@/constants/config'
import { generateFilterSchema } from '@/shared'
@DIEGOHORVATTI
DIEGOHORVATTI / create-osx.sh
Created November 10, 2024 02:41
Creating a bootable USB from a macOS dmg file
#!/bin/bash
# Função de ajuda
show_help() {
echo "Uso: $0 --dmg <caminho_para_o_arquivo.dmg> --usb <dispositivo_usb>"
echo
echo "Exemplo: $0 --dmg ./sonoma.dmg --usb /dev/sdb"
exit 1
}
@DIEGOHORVATTI
DIEGOHORVATTI / shutdown.sh
Created April 3, 2023 20:35
Desligar macos em 1hora com mensagem de debug
sudo shutdown -h +60 && for i in {60..1}; do echo -e "\033[1;33mDesligando em $i minutos...\033[0m"; sleep 60; done; sudo shutdown -h now
@DIEGOHORVATTI
DIEGOHORVATTI / stopScrenn.sh
Created March 23, 2023 14:04
Este script adiciona variáveis de configuração no início do script para permitir que o usuário as altere facilmente. Ele também verifica se o comando "xset" está disponível e se o usuário tem permissão para executá-lo. Além disso, ele adiciona um manipulador de sinal para lidar com interrupções e uma verificação para um arquivo de controle que p…
#!/bin/bash
# Configurações
TIME=30m
LOG="/tmp/inativo.log"
STOP_FILE="/tmp/inativo.stop"
# Verifica se o comando xset está disponível
if ! which xset >/dev/null; then
echo "Erro: o comando xset não está disponível." >&2
[
{
"key": "shift+alt+1",
"command": "numberedBookmarks.toggleBookmark1",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+1",
"command": "-numberedBookmarks.toggleBookmark1",
"when": "editorTextFocus"
@DIEGOHORVATTI
DIEGOHORVATTI / .gitignore
Last active June 27, 2022 09:51
.gitgnore de C
# Binarios de C
/.exe
*/.exe
@DIEGOHORVATTI
DIEGOHORVATTI / min.c
Last active July 5, 2022 04:31
minimo arquivo C
#include <stdio.h>
int main(){
return 0;
}
@DIEGOHORVATTI
DIEGOHORVATTI / varifica_execucao.c
Last active May 19, 2022 12:32
Verificar tempo de execução de programa em C
#include <stdio.h>
#include <time.h> //clock(), CLOCKS_PER_SEC e clock_t
int main(void){
printf(" %s", "Ler 3 valores e escrevê-los em ordem crescente.\n\n");
int maior, menor, piloto=3, notas[piloto], cache_maior=0;
maior=menor=0;
@DIEGOHORVATTI
DIEGOHORVATTI / styles_nextjs.tsx
Last active May 19, 2022 12:16
styles nextjs
<style jsx>{`
#component{
background: url(${projects[projectIndex].cover});
width: 100vw;
height: 30vh;
}
`}</style>
@DIEGOHORVATTI
DIEGOHORVATTI / .zshrc
Last active December 10, 2022 21:29
minha config do zsh
#date
# Path to your oh-my-zsh installation.
export PATH=$PATH:$GOPATH/bin
export ZSH="$HOME/.oh-my-zsh"
export TERM="xterm-256color"
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
#colors
alias ls="colorls --group-directories-first --almost-all"