Install Package Control for easy package management.
- Open the console with
Ctrl+`
- Paste in the following:
<!-- | |
CHECK IF A STRING IS NULL OR EMPTY | |
--> | |
<!-- Example XML --> | |
<group> | |
<item> | |
<id>item 1</id> | |
<CategoryName>blue</CategoryName> | |
</item> |
Install Package Control for easy package management.
Ctrl+`
@function em($target, $context: $base-font-size) { | |
@if $target == 0 { @return 0 } | |
@return $target / $context + 0em; | |
} | |
$base-font-size: 15px; | |
h1 { | |
font-size: em(21px, 15px); // Outputs 1.4em | |
} |
<?xml version='1.0' encoding='iso-8859-1'?> | |
<!-- XHTML-to-Markdown converter by Andrew Green, Article Seven, http://www.article7.co.uk/ --> | |
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. --> | |
<xsl:stylesheet version='1.0' xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> | |
<xsl:output method='text' encoding='utf-8'/> | |
function cartesianProductOf() { | |
return _.reduce(arguments, function(a, b) { | |
return _.flatten(_.map(a, function(x) { | |
return _.map(b, function(y) { | |
return x.concat([y]); | |
}); | |
}), true); | |
}, [ [] ]); | |
}; |
@foreach (array_slice($posts->toArray(), 0, 5) as $post) | |
<h1>{{ $post['title'] }}</h1> | |
@endforeach |
<?php | |
/** | |
* Custom Datasource Skeleton | |
* | |
* A bare-bones example of a custom datasource for use with Symphony 2.3 | |
* | |
* @author: Ian Young | |
* @email: i.young@me.com | |
* @date: 12.01.2014 |
<!-- Add the 'math' namespace to your XML stylesheet (so we can use 'math:random') --> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:math="http://exslt.org/math" | |
extension-element-prefixes="math"> | |
<!-- Pick a random number between 1 - 10 and set as a variable --> | |
<xsl:value-of select="(floor(math:random()*10) mod 10) + 1" /> |
<!-- | |
ALTERNATIVE SEARCH & REPLACE | |
string: The text to be evaluated | |
replace: The character or string to look for in the above string | |
with: What to replace it with | |
Slightly more long winded approach if that's how you prefer to roll. | |
--> | |
<xsl:template name="string-replace"> |
Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.
Once you have a remote set up for one of your upstreams, run these commands with:
git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]
Once set up, git remote -v
should show two (push) URLs and one (fetch) URL. Something like this: