Skip to content

Instantly share code, notes, and snippets.

@javifm86
javifm86 / gist:399456455cc15c334de95cf5149a6abd
Created September 10, 2018 09:09
pre-commit prettier + js-beautify for HTML
#!/bin/sh
jsfiles=$(git diff --cached --name-only --diff-filter=ACM "*.js" "*.jsx" "*.ts" "*.css" "*.scss" | tr '\n' ' ')
if [ "$jsfiles" != "" ]; then
# Prettify all staged .js files
echo "$jsfiles" | xargs ./node_modules/.bin/prettier --write
# Add back the modified/prettified files to staging
echo "$jsfiles" | xargs git add
fi
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@javifm86
javifm86 / killport.bat
Created September 2, 2021 07:51
Kill port in windows
for /f "tokens=5" %%a in ('netstat -aon ^| find ":4500" ^| find "LISTENING"') do taskkill /f /pid %%a
@javifm86
javifm86 / vscode-default-color-theme.json
Last active July 22, 2024 08:05
Default colors used in VSCode, useful if you want to create your own theme using your color palette and want to provide similar colors to the defaults ones.
{
"name": "Default colors dark",
"type": "dark",
"colors": {
// Base colors
"focusBorder": "#007fd4",
"foreground": "#cccccc",
"widget.shadow": "#0000005c",
// "selection.background": // null
@javifm86
javifm86 / launch.json
Created March 23, 2023 10:18
Attaching debugger to backend in NestJS
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Backend attatch"
@javifm86
javifm86 / launch.json
Created March 23, 2023 10:19
Launch NestJS backend with debugger in VSCode
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Nest Framework",
"args": ["${workspaceFolder}/src/main.ts"],
"runtimeArgs": [
"--nolazy",