Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.
- Go to
settings
. - Search for
live templates
. - Under the javascript section you should be able to manage your templates.
package com.example.irfan.rest; | |
import org.springframework.boot.actuate.health.HealthEndpoint; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController |
#!/usr/bin/env bash | |
# Secure workaround for https://issues.sonatype.org/browse/MVNCENTRAL-1369 | |
# Navigate to the root of your Spring Boot project where a Maven wrapper is present and run this script | |
cd .mvn/wrapper | |
wget https://gist.githubusercontent.com/kbastani/d4b4c92969ec5a22681bb3daa4a80343/raw/f166086ef051369383b02dfb74317cd07b6f2c6e/settings.xml | |
cd ../../ | |
./mvnw clean install -s .mvn/wrapper/settings.xml |
## Expand | |
const sectionEl = document.querySelector("section[data-purpose='sidebar']"); const checkboxes = sectionEl.querySelectorAll("input[type='checkbox']"); checkboxes.forEach((checkbox) => { if (!checkbox.checked) { checkbox.disabled = false; checkbox.click(); } }); | |
## Mark as Complete | |
const checkboxes = document.querySelectorAll("input[type='checkbox']"); | |
checkboxes.forEach((checkbox) => { | |
if(!checkbox.checked) { | |
checkbox.click();}}) |
# Find add 'node_modules' | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# Delete all | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
#https://github.com/Ortanon/mongo | |
docker pull karimtemple/mongo | |
mkdir db && sudo chmod 777 db | |
docker run --platform linux/amd64 --name mongodb --rm -d -p 27017:27017 --user 202:202 -v $(pwd)/db:/data/db karimtemple/mongo |
#!/bin/bash | |
# | |
# Automatically adds branch name and branch description to every commit message. | |
# Modified from the gist here https://gist.github.com/bartoszmajsak/1396344 | |
# | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
RED="\033[1;31m" | |
GREEN="\033[1;32m" |
# subl /usr/local/etc/php/7.3/conf.d/ext-xdebug.ini | |
[xdebug] | |
xdebug.mode = debug | |
xdebug.max_nesting_level = 1000 | |
xdebug.start_with_request=yes | |
xdebug.client_port=9090 | |
xdebug.client_host=127.0.0.1 | |
xdebug.discover_client_host=1 | |
xdebug.idekey=PHPSTORM |
<?php | |
// paste this file in root folder of your project | |
// and run command "valet link ." | |
class LocalValetDriver extends LaravelValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* |
sudo yum update | |
# Installing ZSH | |
sudo yum -y install zsh | |
# Check ZSH has been installed | |
zsh --version | |
# Install "util-linux-user" because "chsh" is not available by default | |
# See https://superuser.com/a/1389273/599050 |