This file contains 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
// source: https://stackoverflow.com/questions/78121173/how-to-graceful-shutdown-an-express-docker-app | |
// Option 1 | |
process.on("SIGTERM", function(code_signal_error){ | |
process.exit(0) //or whatever you want | |
}) | |
// Option 2 |
This file contains 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
// Importing | |
const fs = require("fs"); | |
const https = require("https"); | |
// INSTRUCTIONS TO RUN THE TEST | |
// Dear tester, just replace the bellow value with the path of the file you want to test | |
// and everything will work | |
const testFilePath = "url.txt"; // REPLACE ME! |
This file contains 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
private formatDate = (date: Date): string => { | |
const formatedDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(); | |
const formatedTtime = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); | |
const dateTime = formatedDate + " " + formatedTtime; | |
return dateTime; | |
}; |
This file contains 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 static function getSerialNumber() | |
{ | |
// Get the last created order | |
$lastOrder = Product::orderBy('created_at', 'desc')->first(); | |
if (!$lastOrder) | |
// We get here if there is no order at all | |
// If there is no number set it to 0, which will be 1 at the end. | |
$number = 0; | |
else |
This file contains 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
<?php | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| API Routes | |
|-------------------------------------------------------------------------- | |
| |
This file contains 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
.contenedor{ | |
width: 90%; | |
max-width: 1000px; | |
margin: 20px auto; | |
background-color: red; | |
} |
This file contains 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
<?php | |
namespace App\Traits; | |
/* | |
|-------------------------------------------------------------------------- | |
| Api Response Trait | |
|-------------------------------------------------------------------------- | |
| | |
| This trait will be used for any response we sent to clients. |
This file contains 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
<--challenge 1--> | |
<style> | |
.container{ | |
margin-top: 25px; | |
} | |
.col { | |
background-color: #19E58D; | |
border: 1px solid white; | |
padding: 50px; | |
} |
NewerOlder