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
| #!/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' |
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
| 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. |
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 { 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', | |
| }), |
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
| #![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(); |
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
| [package] | |
| name = "week2_rust_rocket" | |
| version = "0.0.1" | |
| authors = ["Geovane Guibes"] | |
| [dependencies] | |
| rocket = "0.4.10" |
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
| [dependencies] | |
| rocket = "0.5.0-rc.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
| name: Java CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: |
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
| @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) | |
| } |
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
| @DeleteMapping("{id}") | |
| fun deleteMovie(@PathVariable id: Long): String { | |
| return movieService.deleteMovie(id) | |
| } |
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
| @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) | |
| } |
NewerOlder