snipt

Ctrl+h for KB shortcuts

Text only

Checking which ES6 features are supported by NodeJS

node --v8-options | grep harmony
https://snipt.net/embed/879f10c855416ad18f4aba097095f996/
https://snipt.net/raw/879f10c855416ad18f4aba097095f996/
879f10c855416ad18f4aba097095f996
text
Text only
1
2016-08-26T13:23:36
True
False
False
Oct 12, 2015 at 02:19 AM
/api/public/snipt/141626/
checking-which-es6-features-are-supported-by-nodejs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>node --v8-options | grep harmony </span></pre></div> </td></tr></table>
cli, es6, harmony, node

PHP

Get values for a given field

<?php $items = field_get_items('node', $node, 'field_myfield'); ?>
https://snipt.net/embed/09efaf02803e1fb57731f5f45a66da9b/
https://snipt.net/raw/09efaf02803e1fb57731f5f45a66da9b/
09efaf02803e1fb57731f5f45a66da9b
php
PHP
1
2016-08-18T06:45:20
True
False
False
/api/public/snipt/47975/
get-values-for-a-given-field
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> <span class="nv">$items</span> <span class="o">=</span> <span class="nx">field_get_items</span><span class="p">(</span><span class="s1">&#39;node&#39;</span><span class="p">,</span> <span class="nv">$node</span><span class="p">,</span> <span class="s1">&#39;field_myfield&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
"drupal 7", field, node

PHP

Get the current node

<?php $node =& menu_get_object(); ?>
https://snipt.net/embed/a146b9faccc8b5cb4ab57be3b6881faf/
https://snipt.net/raw/a146b9faccc8b5cb4ab57be3b6881faf/
a146b9faccc8b5cb4ab57be3b6881faf
php
PHP
1
2016-08-18T06:46:04
True
False
False
/api/public/snipt/47974/
get-the-current-node
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> <span class="nv">$node</span> <span class="o">=&amp;</span> <span class="nx">menu_get_object</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
"drupal 7", node
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.