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.
| var jsonData = pm.response.json(); | |
| pm.environment.set("jwt", jsonData.access_token); | |
| function parseJwt (token,part) { | |
| var base64Url = token.split('.')[part]; | |
| var words = CryptoJS.enc.Base64.parse(base64Url); | |
| var jsonPayload = CryptoJS.enc.Utf8.stringify(words); | |
| return JSON.parse(jsonPayload); | |
| }; |
| #!/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 |
| # 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 '{}' \; |
| 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 |
| { | |
| "USD": { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
| // This makes two connections, one to a tcp server, one to an http server (both in server.js) | |
| // It fires off a bunch of connections and times the response | |
| // Both send strings. | |
| const net = require(`net`); | |
| const http = require(`http`); | |
| function parseIncomingMessage(res) { | |
| return new Promise((resolve) => { |
| #!/usr/bin/php -q | |
| <?php | |
| if(isset($argv[1]) && strlen($argv[1])) { | |
| $file = $argv[1]; | |
| }else{ | |
| echo 'Please Specify a File'; | |
| exit(1); | |
| } |
| [user] | |
| email = irfan-blackhawk | |
| name = [email protected] | |
| [alias] | |
| prune = fetch --prune | |
| # Because I constantly forget how to do this | |
| # https://git-scm.com/docs/git-fetch#git-fetch--p | |
| undo = reset --soft HEAD^ | |
| # Not quite as common as an amend, but still common |