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.
| (ns clojurescript.console.macros | |
| (:refer-clojure :exclude [time])) | |
| (defmacro with-group [title & body] | |
| `(do | |
| (.group js/console ~title) | |
| ~@body | |
| (.groupEnd js/console))) | |
| (defmacro with-group-collpased [title & body] |
| #!/bin/bash | |
| # SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger | |
| # or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work. | |
| # (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q) | |
| /usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config | |
| ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default | |
| rm $TMPDIR/vagrant-ssh-config |
| #!/bin/bash | |
| # This little script creates incremental rsync backups from my | |
| # external Lightroom Library (but could be anything) to another | |
| # external harddrive. Backups are important, you know. | |
| # The result looks like this: | |
| # | |
| # 20120105-1759 | |
| # 20120107-1928 |
| # Linear partition | |
| # Partitions a sequence of non-negative integers into k ranges | |
| # Based on Óscar López implementation in Python (http://stackoverflow.com/a/7942946) | |
| # Also see http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM | |
| # Dependencies: UnderscoreJS (http://www.underscorejs.org) | |
| # Example: linear_partition([9,2,6,3,8,5,8,1,7,3,4], 3) => [[9,2,6,3],[8,5,8],[1,7,3,4]] | |
| linear_partition = (seq, k) => | |
| n = seq.length | |
| #!/bin/bash | |
| # log into your server | |
| ssh root@[server ipaddress] | |
| # change root password | |
| passwd | |
| # update all packages and operating system | |
| apt-get update && apt-get --yes upgrade |
| # download | |
| wget http://downloads.datomic.com/0.8.3848/datomic-pro-0.8.3848.zip | |
| unzip datomic-pro-X.X.zip & cd datomic-pro-X.X | |
| # install as a maven artifact | |
| ./bin/maven-install | |
| # configure transactor.properties | |
| cp config/samples/sql-transactor-template.properties transactor.properties | |
| # protocol=sql |
| /* I, Brandon Martin-Anderson, release this into the public domain or whatever. */ | |
| BufferedReader reader; | |
| double ll, bb, rr, tt; | |
| float A = 1000.0; | |
| GlobalMercator proj = new GlobalMercator(); |
| def scan_forward( fp ): | |
| for line in fp: | |
| if line==[]: | |
| return True | |
| return False | |
| def rowcmp(a,b): | |
| if a==[]: | |
| return 1 | |
| if b==[]: |