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
import { Directive, OnDestroy, OnInit } from "@angular/core"; | |
import { Calendar } from "primeng/calendar"; | |
import { Subject, fromEvent, merge, takeUntil, timer } from "rxjs"; | |
@Directive({ | |
selector: 'p-calendar[ng-calendar-year]' | |
}) | |
export class NgPrimeCalendarYearDirective implements OnInit, OnDestroy { | |
maxDateYear: number | null = null; |
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
@ECHO OFF | |
set FIREBASE_AUTH_EMULATOR_HOST=localhost:9099 | |
set GCLOUD_PROJECT=handytec-webpage-test | |
START cmd /k "echo Hello %FIREBASE_AUTH_EMULATOR_HOST%! %GCLOUD_PROJECT%! && firebase emulators:start --import=./emulators.backup" | |
TIMEOUT /t 15 | |
START cmd /k "echo Hello %FIREBASE_AUTH_EMULATOR_HOST%! %GCLOUD_PROJECT%! && gradlew build && java -jar build/libs/app.jar" | |
EXIT | |
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
```js | |
export function validateCorporativeEmail(control: AbstractControl) { | |
const valueEmail: string | null = control.value; | |
const emailToVerify = valueEmail ||''; | |
const emailDomain = emailToVerify.substring(emailToVerify.indexOf("@") + 1, emailToVerify.lastIndexOf(".")); | |
if (emailToVerify === '' || ["gmail", "outlook", "hotmail", "yahoo", "icloud", "aol", "live", "msn", "yopmail", "mail"].includes(emailDomain)) { | |
return { invalidCorporativeEmail: true }; | |
} | |
return null; | |
} |
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
## Install NVM on macOS | |
brew install nvm | |
mkdir ~/.nvm | |
Edit your shell config file to add the path to the NVM home directory. The shell config file would be ~/.bash_profile if you are using Bash, or ~./zshrc if you are using Zsh, the default shell for MacOS Catalina and later versions. | |
# open config file | |
nano ~/.zshrc | |
# add the nvm path | |
export NVM_DIR="$HOME/.nvm" |
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
## Database connection | |
mysql://host.docker.internal:3306 | |
# Run MySQL on Docker | |
docker run --net=host --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env=MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 --volume=/var/lib/mysql:/var/lib/mysql:rw --detach --name=smdev mysql | |
## Build Image and run it | |
docker build -t portalbackv2 . | |
docker run --name imageportalbackv2 -p 8080:8080 portalbackv2 |
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
## Filter by month, year or day | |
YEAR(usageDate) = 2023 | |
MONTH(usageDate) = 12 | |
# Manage JSON | |
SELECT JSON_OBJECTAGG(notificationTemplateType, true) | |
FROM (SELECT DISTINCT notificationTemplateType FROM APP_NOTIFICATION_TEMPLATE) AS unique_notification_types; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>Microsoft Azure App Service - Welcome</title> | |
<link rel="shortcut icon" href="https://appservice.azureedge.net/images/app-service/v4/favicon.ico" | |
type="image/x-icon" /> |
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
// Coloque sus atajos de teclado en este archivo para sobreescribir los valores predeterminadosauto[] | |
[ | |
{ | |
"key": "ctrl+k ctrl+s", | |
"command": "-workbench.action.openGlobalKeybindings" | |
}, | |
{ | |
"key": "ctrl+numpad_divide", | |
"command": "editor.action.commentLine", | |
"when": "editorTextFocus && !editorReadonly" |
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
// This function converts the byte to the corresponding amount, be it kilo, mega, GB, etc. | |
const convertWeightByte = (byte) => { | |
let sizekiloByte = (byte / 1024); | |
let sizeMega = (sizekiloByte / 1024); | |
let sizeGigabyte = (sizeMega / 1024); | |
let sizeTerabyte = (sizeGigabyte / 1024); | |
let sizePetabyte = (sizeTerabyte / 1024); | |
let sizeExabyte = (sizePetabyte / 1024); | |
if(sizekiloByte > 0 && sizekiloByte <= 1024){ |
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
import { FormControl } from '@angular/forms'; | |
export class CheckboxValidator{ | |
static isChecked(control: FormControl) : any{ | |
if(control.value != true){ | |
return { | |
"notChecked" : true | |
}; |
NewerOlder