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.
@mixin border-radius($values) { | |
@include css3-prefix(3, border-radius, $values); | |
} | |
@mixin box-shadow($x, $y, $offset, $color) { | |
@include css3-prefix(4, box-shadow, $x $y $offset $color); | |
$iecolor: '#' + red($color) + green($color) + blue($color); | |
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'); | |
-ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}')); |
(function() { | |
// Following spec is to expose vendor-specific style properties as: | |
// elem.style.WebkitBorderRadius | |
// and the following would be incorrect: | |
// elem.style.webkitBorderRadius | |
// Webkit ghosts their properties in lowercase but Opera & Moz do not. | |
// Microsoft foregoes prefixes entirely <= IE8, but appears to | |
// use a lowercase `ms` instead of the correct `Ms` in IE9 | |
Array.prototype.binarySearch = function(key) { | |
var low = 0, | |
high = this.length - 1; | |
while (low <= high) { | |
var mid = (low + high) >>> 1; | |
var midVal = this[mid]; | |
if (midVal < key) | |
low = mid + 1; |
inspired by https://www.linkedin.com/profile/view?id=4270384 | |
Fun Face: ᙅ•℧•ᙂ (͡๏̯͡๏) | |
Stars: ★ ✪ ✯ ✰ | |
Arrows: ☛ ☚ ☜ ☝ ☞ ☟ ⇨ ► ◄ ► » → ↓ | |
Traditional bullets: ■ ♦ ◆ ● | |
Ticks: ✔ ✘ ☐ ☑ ☒ | |
Email: ✉ ✍ ✎ ✏ ✑ ⌨ | |
Phone: ✆ ☎ ☏ | |
Misc: ♫ |
var spawn = require('child_process').spawn; | |
var exec = require('child_process').exec; | |
var fs = require('fs'); | |
task('install-deps', ['setup'], function() { | |
console.log('\n\n > Attempting to install dependencies via npm\n'.blue); | |
console.log('\tExecuting command:\n\t$ npm install\n'.grey); | |
var npm = spawn('npm', ['install']); |
#!upstart | |
description "your fancy description that no one will see ;)" | |
author "Your Name <youremail@fqdn>" | |
# start on every run level, 2 is the one on Ubuntu | |
start on runlevel [2345] | |
# stop on halt, maintenance or reboot | |
stop on runlevel [016] |
// the initial seed | |
Math.seed = 6; | |
// in order to work 'Math.seed' must NOT be undefined, | |
// so in any case, you HAVE to provide a Math.seed | |
Math.seededRandom = function(max, min) { | |
max = max || 1; | |
min = min || 0; | |
Math.seed = (Math.seed * 9301 + 49297) % 233280; |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: your_application | |
# Required-Start: $remote_fs $network $syslog | |
# Required-Stop: $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# X-Interactive: false | |
# Short-Description: your fancy description that no one will see ;) |
<!-- html5shiv & set(Timeout|Interval) fix --> | |
<!--[if lte IE 9]> | |
<script> | |
/*@cc_on(function(a,b){function r(a){var b=-1;while(++b<f)a.createElement(e[b])}if(!(!window.attachEvent||!b.createStyleSheet||!function(){var a=document.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d<e){f=a[d];if(f.disabled)continue;b=f.media||b,p.test(b)&&g.push(c.getCSS(f.imports,b),f.c |