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.
| Goal | CSS 3 | XPath | |
|---|---|---|---|
| All Elements | * | //* | |
| All P Elements | p | //p | |
| All Child Elements | p>* | //p/* | |
| Element By ID | #foo | //*[@id=’foo’] | |
| Element By Class | .foo | //*[contains(@class,’foo’)] | |
| Element With Attribute | *[title] | //*[@title] | |
| First Child of All P | p>*:first-child | //p/*[0] | |
| All P with an A child | Not possible | //p[a] | |
| Next Element | p + * | //p/following-sibling::*[0] |
The filter and zoom rules in the sample stylesheet above will apply a smoothing/blurring effect to text elements. In the sample stylesheet, these rules are applied to all headers, paragraphs, list items, and table cells, but in practice, you will want to tailor the application of the smoothing effect to only those elements rendering with significant aliasing.
Nota Bene: the filter appears to place an overflow: hidden-style block around the elements being smoothed, so do not apply these rules directly to elements that need to scroll, or which contain absolutely positioned elements that appear outside the boundaries of the element itself.
| <?php | |
| /* | |
| * Converts CSV to JSON | |
| * Example uses Google Spreadsheet CSV feed | |
| * csvToArray function I think I found on php.net | |
| */ | |
| header('Content-type: application/json'); | |
| // Set your CSV feed |