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
| services: | |
| frontend: | |
| build: | |
| context: ./audio-archive-frontend | |
| args: | |
| - NEXT_PUBLIC_API_URL=http://localhost:5000/api | |
| - NEXT_PUBLIC_MEDIA_URL=http://localhost:5000/media | |
| container_name: audio_archive_frontend | |
| restart: unless-stopped |
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 ThreadPool { | |
| public: | |
| inline ThreadPool(size_t n) : stop(false) { | |
| for (size_t i = 0; i < n; i++) { | |
| workers.emplace_back([this]() { | |
| while (true) { | |
| std::function<void()> task; | |
| { | |
| std::unique_lock lock(this->mtx); | |
| this->cv.wait( |
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
| fn ffmpeg_convert(path: &PathBuf) { | |
| if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) { | |
| println!("webp-daemon: new file created: `{file_name}`"); | |
| let path_str = path.to_string_lossy(); | |
| let mut new_path = PathBuf::from(path); | |
| new_path.set_extension("png"); | |
| let new_path_str = new_path.to_string_lossy(); | |
| let arguments = ["-i", &path_str, &new_path_str]; | |
| if let Ok(status) = Command::new("ffmpeg") | |
| .stderr(Stdio::null()) |
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
| /* Factory receives the Program.cs or the Startup.cs (Program.cs needs to have a class) */ | |
| public class TestWebAppFactory : WebApplicationFactory<Program> { | |
| private DatabaseContext? Db_context { set; get; } | |
| protected override void ConfigureWebHost(IWebHostBuilder builder) { | |
| base.ConfigureWebHost(builder); | |
| IConfiguration configuration = new ConfigurationBuilder().AddJsonFile("appsettings.Test.json").Build(); | |
| builder.ConfigureTestServices((services) => { | |
| /* Removes any instances of the actual application DatabaseContext*/ |
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
| public class DatabaseContext : DbContext { | |
| public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options) {} | |
| /* Set the entity Class (Model) */ | |
| public DbSet<EntityModel> Entity { get; set; } | |
| protected override void OnModelCreating(ModelBuilder modelBuilder) { | |
| modelBuilder.Entity<EntityModel>(entity => { | |
| entity.Property(col => col.Column).HasColumnType("/* SQL DATATYPE */"); | |
| entity.ToTable("/* Column Name */") | |
| }); |