Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / clonehtml5boilerplate-to-komodo-project-directory
Created August 25, 2011 13:21
Komodo Command: git/clone a html5bboilerplate to your currently active komodo project directory (Ubuntu 10.04)
cd '%p'; git clone https://github.com/paulirish/html5-boilerplate.git
@pepebe
pepebe / Komodo wget html5boilerplate
Created August 27, 2011 08:44
Komodo: Download html5boilerplate and unzip it into projectdirectory/project/root
cd '%p'; mkdir project; cd '%p'/project; wget -O boilerplate.zip http://github.com/paulirish/html5-boilerplate/zipball/v2.0stripped; unzip boilerplate.zip; mv paul* root
@pepebe
pepebe / box_rotate.css
Created August 28, 2011 10:29
komodo: .box_rotate (transform snippet for Komodo Edit)
.csstransforms .box_rotate {
/* use modernizr to give these rules only to capable browsers */
-moz-transform: rotate([[%ask1:Grad:90.0]]deg); /* FF3.5+ */
-o-transform: rotate([[%ask1]]deg); /* Opera 10.5 */
-webkit-transform: rotate([[%ask1]]deg); /* Saf3.1+, Chrome */
-ms-transform: rotate([[%ask1]]deg); /* IE9 */
transform: rotate([[%ask1]]deg);
-webkit-transform-origin: [[%ask2:left:50%]] [[%ask3:top:50%]];
-moz-transform-origin: [[%ask2]] [[%ask3]];
@pepebe
pepebe / .box_lgradient.css
Created August 28, 2011 10:35
.box_lgradient (linear gradient snippet for Komodo Edit)
.box_lgradient {
background-color: #[[%ask1:from:444444]];
background-image: -webkit-gradient(linear, left top, left bottom, from(#[[%ask1]]), to(#[[%ask2:to:999999]])); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #[[%ask1]], #[[%ask2]]); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #[[%ask1]], #[[%ask2]]); /* FF3.6 */
background-image: -ms-linear-gradient(top, #[[%ask1]], #[[%ask2]]); /* IE10 */
background-image: -o-linear-gradient(top, #[[%ask1]], #[[%ask2]]); /* Opera 11.10+ */
background-image: linear-gradient(top, #[[%ask1]], #[[%ask2]]);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#[[%ask1]]', EndColorStr='#[[%ask2]]'); /* IE6–IE9 */
}
@pepebe
pepebe / ul.reset
Created August 28, 2011 15:15
css: reset class for unordered lists
ul.reset,
ul.reset li,
ul.reset ul li {
margin:0;
padding: 0;
text-indent: 0;
list-style-type: 0;
}
@pepebe
pepebe / download homepage
Created August 29, 2011 20:58
wget: Download Client homepage with wget (Komodo Snippet)
cd '%p'; mkdir downloads; cd downloads; wget -r -l%(ask2:Depth:1) -k http://%(ask1:URL);
@pepebe
pepebe / extract-images-from-pdf
Created October 4, 2011 14:08
pdf: Extract images from pdf
pdfimages -j foo.pdf bar
Much easier with a nautilus script (see comments).
@pepebe
pepebe / gist:1670095
Created January 24, 2012 13:05
MODX: How to find how many parents a document has?
Question by: highlander
Is there a way to know how many parents any given document has or, how far down the tree structure a document is located?
Solution by: opengeek
Updated by: pepebe to work with MODX REVO 2.2.0-pl2
Source: http://forums.modx.com/index.php?topic=18747.0;wap2
noOfParents snippet:
@pepebe
pepebe / gist:1681126
Created January 26, 2012 05:07
Oxid: Abfrage nach Gruppenzugehörigkeit
Source: http://www.oxid-esales.com/forum/showthread.php?t=10050
[{if $oxcmp_user && $oxcmp_user->inGroup('blub')}]
ist in gruppe
[{else}]
ist nicht in gruppe
[{/if}]
@pepebe
pepebe / gist:1699146
Created January 29, 2012 14:53
js: Calculate width of text inside a container
function textWidth(text){
var calc = '<span style="display:none">' + text + '</span>';
$('body').append(calc);
var width = $('body').find('span:last').width();
$('body').find('span:last').remove();
return width;
};