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
| $date = date('Y-m-d H:i:s'); |
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
| UPDATE tabla1 t1 | |
| SET t1.valor = (SELECT t2.CODE FROM tabla2 t2 WHERE t1.valor = t2.DESC and t1.fecha=t2.fecha) | |
| WHERE t1.filtro='correcto' | |
| AND EXISTS (SELECT t2.CODE FROM tabla2 t2 WHERE t1.valor = t2.DESC and t1.fecha=t2.fecha); | |
| -- O | |
| UPDATE | |
| (SELECT t1.valor as OLD, t2.CODE as NEW | |
| FROM tabla1 t1 |
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
| //... | |
| if (criteria.getIdTipoComunicado() != null) { | |
| Join<ComunicadoGrupo, Comunicado> comunicado = root.join("listComunicado"); | |
| Join<Comunicado, TipoComunicado> tipoComunicado = comunicado.join("tipoComunicado"); | |
| predicates.add(criteriaBuilder.equal(tipoComunicado.get("idTipoComunicado"), criteria.getIdTipoComunicado())); | |
| } | |
| //... |
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
| //... ReadOnly // new FormControl({value: null, disabled: true}, Validators.required), | |
| this.registerForm = this.formBuilder.group({ | |
| first_name: ['', Validators.required], | |
| last_name: ['', Validators.required], | |
| email: new FormControl({value: null, disabled: true}, Validators.required), | |
| password: ['', Validators.compose([Validators.required, Validators.email])], | |
| confirm_password: ['', Validators.required], | |
| }); | |
| //... Get Values | |
| this.registerForm.getRawValue(); |
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 LoadResourceInsideJar { | |
| // ... | |
| @PostConstruct | |
| public void init() { | |
| try { | |
| Resource resource = resourceLoader.getResource("classpath:emailTemplate.html"); | |
| InputStream resourceAsStream = resource.getInputStream(); // <-- this is the difference (Jar Embedded) | |
| } catch (IOException | NullPointerException e) { | |
| LOGGER.error("Resource couldn't be loaded. ", e); | |
| } |
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
| SCRIPT NODATA TO 'script.sql'; |
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
| --spring.config.location=file:///E:/properties/nameapp-application.yml | |
| --spring.config.location=file:///E:/properties/nameapp-application.properties | |
| java -jar name-app.jar --spring.config.location=file:///C:/properties/application.yml |
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 FormatDate { | |
| private static CellStyle getFormatAsDate(Workbook workbook) { | |
| CreationHelper creationHelper = workbook.getCreationHelper(); | |
| CellStyle cellStyle = workbook.createCellStyle(); | |
| cellStyle.setDataFormat(creationHelper.createDataFormat().getFormat("dddd dd/MM/yyyy hh:mm:ss")); | |
| return cellStyle; | |
| } | |
| } |
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 RestControllerExcel{ | |
| @GetMapping(value="/downloadTemplate") | |
| public ResponseEntity<ByteArrayResource> downloadTemplate() throws Exception { | |
| try { | |
| ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
| XSSFWorkbook workbook = createWorkBook(); // creates the workbook | |
| HttpHeaders header = new HttpHeaders(); | |
| header.setContentType(new MediaType("application", "force-download")); | |
| header.set(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=ProductTemplate.xlsx"); | |
| workbook.write(stream); |
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
| <?php | |
| require('vendor/autoload.php'); | |
| use \Firebase\JWT\JWT; | |
| class ImplementJwt { | |
| //////////The function generate token///////////// | |
| PRIVATE $key = "uEsHptabPr3qIjjyFrOK2G7PMbh82Czi"; | |
| public function GenerateToken($data) { | |
| $jwt = JWT::encode($data, $this->key); | |
| return $jwt; |
NewerOlder