miércoles, 30 de marzo de 2022

Configuración Personal Visual Studio Code

{
"editor.fontSize": 16,
"window.zoomLevel": 0,
"editor.fontFamily": "Hasklig, Mononoki Nerd Font, Consolas, 'Courier New', monospace",
"editor.letterSpacing": 0.3,
"editor.parameterHints.enabled": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.folding": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.suggest.preview": true,
"editor.minimap.enabled": false,
"editor.wordWrap": "on",
"editor.smoothScrolling": true,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active",
"editor.linkedEditing": true,
"editor.cursorBlinking": "smooth",
"editor.renderWhitespace": "selection",
"extensions.ignoreRecommendations": true,
"workbench.list.smoothScrolling": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": false,
"files.trimTrailingWhitespace": true,
"workbench.startupEditor": "none",
"workbench.settings.editor": "json",
"workbench.editor.wrapTabs": true,
"window.titleBarStyle": "custom",
"workbench.iconTheme": "material-icon-theme",
"workbench.sideBar.location": "right",
"workbench.activityBar.visible": false,
"window.restoreWindows": "none",
"git.ignoreMissingGitWarning": true,
"terminal.integrated.profiles.windows": { "Git Bash": { "path": "C:\\Program Files\\Git\\bin\\bash.exe" } },
"terminal.integrated.fontFamily": "MesloLGM NF",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.fontSize": 16,
// "files.autoSave": "onFocusChange",
"explorer.autoReveal": false,
"explorer.sortOrder": "type",
"explorer.openEditors.visible": 0,
"editor.occurrencesHighlight": false,
//"editor.glyphMargin": false,
//"editor.renderWhitespace": "all",
"workbench.editor.enablePreview": false,
"comment-divider.mainHeaderFiller": "=",
"prettier.tabWidth": 2,
"prettier.useTabs": false,
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.printWidth": 120,
"prettier.bracketSpacing": true,
// "prettier.semi": true,
//"editor.rulers": [120],
"php.suggest.basic": false,
"php.validate.executablePath": "C:\\laragon\\bin\\php\\php-8.1.1-Win32-vs16-x64\\php.exe",
"php.executablePath": "C:\\laragon\\bin\\php\\php-8.1.1-Win32-vs16-x64\\php.exe",
"intelephense.format.braces": "k&r",
"workbench.tree.indent": 17,
"html.autoClosingTags": true,
"css.validate": true,
"scss.validate": true,
"less.validate": true,
"javascript.validate.enable": false,
"eslint.enable": true,
"eslint.validate": ["javascript"],
"eslint.alwaysShowStatus": true,
"material-icon-theme.folders.color": "#FFCA39",
"workbench.colorTheme": "Material Dark Theme",
"kite.showWelcomeNotificationOnStartup": false,
"window.menuBarVisibility": "toggle",

"workbench.colorCustomizations": {
"titleBar.activeBackground": "#09090F",
"editor.background": "#0D0D15",
"activityBar.background": "#0F0F1A",
"activityBar.border": "#3F3F46",
"sideBar.background": "#12111a",
"sideBar.border": "#434343",
"sideBar.foreground": "#DFDFDF",
"sideBarSectionHeader.background": "#37373D",
"activityBar.foreground": "#a9ebff",
"activityBar.inactiveForeground": "#6B7A83",
// "activityBar.activeBackground": "#ccda14",
"activityBarBadge.background": "#00e6cb",
"activityBarBadge.foreground": "#000000",
"list.activeSelectionBackground": "#28537D",
"list.inactiveSelectionBackground": "#28537D",
"editorIndentGuide.activeBackground": "#8BD0FE",
"editorIndentGuide.background": "#1E292F",
"editorSuggestWidget.selectedBackground": "#005F9D",
"editorSuggestWidget.highlightForeground": "#00F4D6",
"editorSuggestWidget.foreground": "#e7e5e5",
"editorSuggestWidget.border": "#4A4A4A",
"list.inactiveSelectionForeground": "#fff",
"tab.activeBorder": "#52DCFF",
"tab.inactiveBackground": "#171620",
"tab.activeBackground": "#1F4061",
"tab.inactiveForeground": "#888888",
"editorGroupHeader.tabsBackground": "#171620",
"editorCursor.foreground": "#FFCC00",
// "editor.wordHighlightBackground": "#39f00b",
"editor.wordHighlightBackground": "#1e1e1e00",
"panel.border": "#007ACC",
"statusBar.background": "#4A1757",
"editor.lineHighlightBackground": "#0D0D15",
"editor.lineHighlightBorder": "#4F5960",
"editorLineNumber.activeForeground": "#FFF",
"editorLineNumber.foreground": "#596268",
"editor.selectionBackground": "#264F78",
"editorBracketMatch.background": "#464646",
"editorBracketMatch.border": "#1E1E1E",
"scrollbarSlider.hoverBackground": "#343C40",
"scrollbarSlider.background": "#343C40",
"scrollbarSlider.activeBackground": "#343C40",
"editor.findMatchHighlightBackground": "#660",
"editor.findMatchBackground": "#8f1527",
"list.hoverBackground": "#343C40",
"list.focusBackground": "#1B67A5",
"pickerGroup.foreground": "#00F4D6",
"editorWidget.resizeBorder": "#6ffd62",
"editorWidget.background": "#0c142c",
"selection.background": "#244B73",
"widget.shadow": "#2e393f"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},

"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}

},

"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2
},

"emmet.includeLanguages": {
"javascript": "html",
"php": "html"
},


"editor.tokenColorCustomizations": {
"[Material Dark Theme]": {
"comments": "#8B9398",
"functions": "#9BBCFF",
// "strings": "#FF0000",

"textMateRules": [
{
"scope": ["entity.other.attribute-name"],
"settings": {
"foreground": "#FFCB6B"
}
},
{

"scope": ["punctuation.section.embedded"],
"settings": {
"foreground": "#EE8CF0"
}
},
{

"scope": ["keyword.control"],
"settings": {
"fontStyle": "italic"
}
}
]
}
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"files.associations": {
"*.json": "jsonc"
}
}

lunes, 21 de marzo de 2022

Instalar oh-my-posh para Git Bash

Instalar oh-my-posh
-----------------------------
Ejecutar en powershell:
$> Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))

Descargar Tipografia:https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
Cambiar la Tipografia
Fuente:Meslo LGM NF
En la New terminal Window ir a setting.json
-----------------------
"defaults": {
"fontFace": "MesloLGM NF",
"fontSize": 12
},

-----------------------

Agregar la terminal de Git Bash en la nueva terminal de Windows
Generar un GUID para Gitbash
$> [guid]::NewGuid()

Ir a Windows Terminal -> configuracion -> Settings.json
------------------------------------------------------------------------
{
"guid": "{9221567d-b681-4c90-ba59-7585f5ae8b24}",
"hidden": false,
"name": "Git Bash",
"commandline": "C:/Program Files/Git/bin/bash.exe --login",
"icon": "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico",
"startingDirectory": "%USERPROFILE%"
}
------------------------------------------------------------------------

Crear un archivo .bashrc en el usuario actual
$> touch ~/.bashrc

Agregar en el archivo la siguiente linea.
$> vim ~/.bashrc
eval "$(oh-my-posh --init --shell bash --config ~/AppData/Local/Programs/oh-my-posh/themes/aliens.omp.json)"

$> exec bash

Eliminar el hostname del terminal bash

$> vim ~/AppData/Local/Programs/oh-my-posh/themes/aliens.omp.json

:12 "template": " {{ .UserName }}@{{ .HostName }} "

PERSONALIZAR LA TERMINAL DE GITBASH

PERSONALIZAR LA TERMINAL DE GITBASH - Ohmybash
-----------------------------------------------------------------------------------
$> bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
$> vim ~/.bashrc
Editar theme
6: OSH_THEME="agnoster"

$>
source ~/.bashrc

Descargar Tipografia: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
Cambiar la Tipografia
Fuente:Meslo LGM NF

Personalizar el theme Agnoster
------------------------------------------
$> cd ~/.oh-my-bash
$> cd themes/agnoster
$> vim agnoster.theme.sh
Eliminar el hostname
:233 prompt_segment white black "$user"

martes, 15 de marzo de 2022

SOLUCION ::: Fatal error: Uncaught Error: Call to undefined function imagecreatefrompng()

 

SOLUCION ::: Fatal error: Uncaught Error: Call to undefined function imagecreatefrompng()



Habilitar extensión PHP-GD
Ingresar a php.ini
 c:/xampp/php 

Habilitar extension :
extension=gd;

miércoles, 2 de marzo de 2022

INSTALAR ESLINT


INSTALAR ESLINT
----------------------------
$> npm install eslint -D
$> npx eslint --init

Reglas de Configuracion:
Crear el archivo .eslintrc.js
Ir node_modules ->.eslintrc.js
------------------------------------------
extends: ["standard", "prettier"],
rules: {
    'no-unused-vars': 'warn',
  }

Verifica errores de la carpeta src y subcarpeta los archivos .js
$> npx eslint src/**/*.js

Corrije los errores
$> npx eslint src/**/*.js --fix

Para que sea de forma automática añadir en el archivo package.json:
------------------------------------------------
  // package.json
"scripts": {
  // ...
  "lint": "eslint src/",
  "lint:fix": "eslint src/ --fix"
},
------------------------------------------------
Instalar Prettier
$> npm install --save-dev eslint-config-prettier

Crear archivo .prettierrc.json
---------------------------------------
{
   "singleQuote": true,
   "semi": true,
   "tabWidth": 2,
   "useTabs": false,
   "printWidth": 120,
   "arrowParens": "avoid"
}

Verificar errores
$> npx prettier . --check 
$> npx prettier . --write

Instalar Powershell 7

Instalar Powershell Version 7 -------------------------------------- $> winget search powershell $> winget install Microsoft.Powershe...