Skip to content

Instantly share code, notes, and snippets.

View guibes's full-sized avatar
🌎
Digital Nomad

Geovane Guibes guibes

🌎
Digital Nomad
View GitHub Profile
@guibes
guibes / setup-mx-keys-mini.sh
Last active January 10, 2026 23:01
MX Keys Mini Setup for Hyprland (Omarchy)
#!/bin/bash
set -e
echo "=== MX Keys Mini Setup for Hyprland (Arch Linux) ==="
echo ""
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
Optimize image size
Run multiples commands in a single run, for example when we need update the registry of applications and install some application in a ubuntu image we can run at the same RUN command, this helps to decrease the number of layers in our image, reducing the size and the execution time.
RUN apt-get update && apt-get install ffmpeg
Select the right image, for example to node can use the node:bullseye-slim is smaller than the official node image, see the picture:The official one is around 380 MB and the bullseye-slim is around 66 MB a huge difference. Reference: https://hub.docker.com/_/node/tags
Use Multi-Staged Builds, for a smaller image is always recommended to use multi-staged builds, for example use a image to build and another one to run the project.
@guibes
guibes / app.module.ts
Created October 10, 2022 11:58
App module with OpenTelemetry
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { OpenTelemetryModule } from '@metinseylan/nestjs-opentelemetry';
@Module({
imports: [
OpenTelemetryModule.forRoot({
applicationName: 'nestjs-opentelemetry',
}),
@guibes
guibes / main.rs
Created April 5, 2022 02:10
Rocket Rust main file
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
fn main() {
rocket::ignite().mount("/", routes![index]).launch();
@guibes
guibes / Cargo.toml
Created April 5, 2022 02:09
Stable Rocket Version
[package]
name = "week2_rust_rocket"
version = "0.0.1"
authors = ["Geovane Guibes"]
[dependencies]
rocket = "0.4.10"
@guibes
guibes / Cargo.toml
Created April 5, 2022 01:37
Add rocket to our project
[dependencies]
rocket = "0.5.0-rc.1"
@guibes
guibes / gradle.yml
Created April 2, 2022 20:16
GithubActionForJava
name: Java CI
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
@guibes
guibes / DeleteMovieTest.kt
Created April 2, 2022 17:28
DeleteMovieTest [DAY-6-7]
@Test
fun `@DELETE delete movie need throw an not found if the movie does not exists was missing`() {
val movie: Movie = MovieFactory().produce()
val createdMovie: Movie = movieRepository.save(movie)
mockMvc.perform(MockMvcRequestBuilders.delete("/api/movies/" + createdMovie.id))
.andExpect(MockMvcResultMatchers.status().isOk)
}
@guibes
guibes / DeleteMovieMethod.kt
Created April 2, 2022 17:24
DeleteMovieMethod [DAY-6-7]
@DeleteMapping("{id}")
fun deleteMovie(@PathVariable id: Long): String {
return movieService.deleteMovie(id)
}
@guibes
guibes / NotFoundExceptionDeleteTest.kt
Created April 2, 2022 17:23
NotFoundExceptionDeleteTest [DAY-6-7]
@Test
fun `@DELETE delete movie need throw an not found if the movie does not exists was missing`() {
mockMvc.perform(MockMvcRequestBuilders.delete("/api/movies/999"))
.andExpect(MockMvcResultMatchers.status().isNotFound)
}