Skip to content

Instantly share code, notes, and snippets.

View vtambourine's full-sized avatar
🦉

Benjamin T vtambourine

🦉
View GitHub Profile

intellij javascript live templates

Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.

How to

  • Go to settings.
  • Search for live templates.
  • Under the javascript section you should be able to manage your templates.
.pt {
font-size: 12pt;
}
.px {
font-size: 16px;
}
.em {
font-size: 1em;
@vtambourine
vtambourine / prompt-url-params-bookmarklet.js
Created February 1, 2012 09:41
Prompt URL parameters bookmarklet
javascript: document.location.search = (function(param, value, location){
search = location.search;
if (search) {
pattern = new RegExp('([\?&]?)'+param+'=([^\?&#]*)');
clue = search.match(pattern);
if (clue) {
search = search.replace(pattern, '$1'+param+'='+value);
} else {
search += '&'+param+'='+value;
}
@vtambourine
vtambourine / url-params-bookmarklet.js
Created January 1, 2012 17:21
Predefined URL parameters bookmarklet
javascript: document.location.search = (function(param, value, location){
search = location.search;
if (search) {
pattern = new RegExp('([\?&]?)'+param+'=([^\?&#]*)');
clue = search.match(pattern);
if (clue) {
search = search.replace(pattern, '$1'+param+'='+value);
} else {
search += '&'+param+'='+value;
}