snipt

Ctrl+h for KB shortcuts

HTML

default drupal menu list items

1
2
3
4
5
<ul>
  <li>Menu Item 1</li>
  <li>Menu Item 2</li>
  <li>Menu Item 3</li>
</ul>
https://snipt.net/embed/c8b0f1e1660cc949bde57c3765540241/
/raw/c8b0f1e1660cc949bde57c3765540241/
c8b0f1e1660cc949bde57c3765540241
html
HTML
5
2019-07-05T17:51:32
True
False
False
/api/public/snipt/2381/
default-drupal-menu-list-items
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">&lt;</span><span class="nt">ul</span><span class="p">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="p">&lt;</span><span class="nt">li</span><span class="p">&gt;</span>Menu Item 1<span class="p">&lt;/</span><span class="nt">li</span><span class="p">&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="p">&lt;</span><span class="nt">li</span><span class="p">&gt;</span>Menu Item 2<span class="p">&lt;/</span><span class="nt">li</span><span class="p">&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="p">&lt;</span><span class="nt">li</span><span class="p">&gt;</span>Menu Item 3<span class="p">&lt;/</span><span class="nt">li</span><span class="p">&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">&lt;/</span><span class="nt">ul</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
drupal, html

PHP

default drupal theme link generate function

<? theme('links', $primary_links);
https://snipt.net/embed/870e6695af34d8f8d0321a407da44158/
/raw/870e6695af34d8f8d0321a407da44158/
870e6695af34d8f8d0321a407da44158
php
PHP
1
2019-07-08T22:35:01
True
False
False
/api/public/snipt/2380/
default-drupal-theme-link-generate-function
<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></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> <span class="nx">theme</span><span class="p">(</span><span class="s1">&#39;links&#39;</span><span class="p">,</span> <span class="nv">$primary_links</span><span class="p">);</span> </span></pre></div> </td></tr></table>
drupal, php

PHP

print a piece of the account profile variable in drupal

<? print t('%zip', array('%zip' => $account->profile_zip_code));
https://snipt.net/embed/7b4868e1584ccf2aa6157d115f21b4c3/
/raw/7b4868e1584ccf2aa6157d115f21b4c3/
7b4868e1584ccf2aa6157d115f21b4c3
php
PHP
1
2019-07-15T00:46:17
True
False
False
/api/public/snipt/2379/
print-a-piece-of-the-account-profile-variable-in-drupal
<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></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> <span class="k">print</span> <span class="nx">t</span><span class="p">(</span><span class="s1">&#39;%zip&#39;</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;%zip&#39;</span> <span class="o">=&gt;</span> <span class="nv">$account</span><span class="o">-&gt;</span><span class="na">profile_zip_code</span><span class="p">));</span> </span></pre></div> </td></tr></table>
drupal, php

PHP

dump account variable in drupal user profile

<? var_dump($account);
https://snipt.net/embed/56152901c1116ff01391601b27457ee5/
/raw/56152901c1116ff01391601b27457ee5/
56152901c1116ff01391601b27457ee5
php
PHP
1
2019-07-13T08:56:18
True
False
False
/api/public/snipt/2378/
dump-account-variable-in-drupal-user-profile
<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></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> <span class="nb">var_dump</span><span class="p">(</span><span class="nv">$account</span><span class="p">);</span> </span></pre></div> </td></tr></table>
drupal, php

PHP

drupal user profile variables for modification

<? $user_profile and $account
https://snipt.net/embed/5ab53985281c7e1c6ac98b583a330d4b/
/raw/5ab53985281c7e1c6ac98b583a330d4b/
5ab53985281c7e1c6ac98b583a330d4b
php
PHP
1
2019-07-12T06:16:26
True
False
False
/api/public/snipt/2377/
drupal-user-profile-variables-for-modification
<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></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> <span class="nv">$user_profile</span> <span class="k">and</span> <span class="nv">$account</span> </span></pre></div> </td></tr></table>
drupal, php

ApacheConf

disable expires header for files ending in txt for using mint with drupal

1
2
3
<FilesMatch "\.(txt)$">
  ExpiresActive Off
</FilesMatch>
https://snipt.net/embed/56bff77530007eac2cb2464bb8b2e253/
/raw/56bff77530007eac2cb2464bb8b2e253/
56bff77530007eac2cb2464bb8b2e253
apacheconf
ApacheConf
3
2019-07-10T05:54:12
True
False
False
/api/public/snipt/2376/
disable-expires-header-for-files-ending-in-txt-for-using-mint-with-drupal
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">&lt;FilesMatch</span> <span class="s">&quot;\.(txt)$&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">ExpiresActive</span> <span class="k">Off</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/FilesMatch&gt;</span> </span></pre></div> </td></tr></table>
apache, drupal, htaccess, mint

Bash

Update Drupal via CVS

cvs update -r DRUPAL-TAG-HERE -dP
https://snipt.net/embed/a883b477ad755bb010bbf94ca4badac4/
/raw/a883b477ad755bb010bbf94ca4badac4/
a883b477ad755bb010bbf94ca4badac4
bash
Bash
1
2019-07-14T08:24:59
True
False
False
/api/public/snipt/1890/
update-drupal-via-cvs
<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></span><span id="L-1"><a name="L-1"></a>cvs update -r DRUPAL-TAG-HERE -dP </span></pre></div> </td></tr></table>
drupal

Text only

reset drupal password

mysql > update drupalusers set pass=md5(’PASS’) where uid = 1;
https://snipt.net/embed/5ad58aeb81ad4d9398f8264cbc2afb18/
/raw/5ad58aeb81ad4d9398f8264cbc2afb18/
5ad58aeb81ad4d9398f8264cbc2afb18
text
Text only
3
2019-07-02T16:31:26
True
False
False
/api/public/snipt/1294/
reset-drupal-password
<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></span><span id="L-1"><a name="L-1"></a>mysql &gt; update drupalusers set pass=md5(’PASS’) where uid = 1; </span></pre></div> </td></tr></table>
drupal, mysql

Bash

Drupal - fgrep - search for what is executed by functions

fgrep -R "theme('terms" *
https://snipt.net/embed/f57e3a1d5454ef4312f2f8fe7026c3c1/
/raw/f57e3a1d5454ef4312f2f8fe7026c3c1/
f57e3a1d5454ef4312f2f8fe7026c3c1
bash
Bash
1
2019-06-20T07:36:45
True
False
False
/api/public/snipt/572/
drupal-fgrep-search-for-what-is-executed-by-functions
<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></span><span id="L-1"><a name="L-1"></a>fgrep -R <span class="s2">&quot;theme(&#39;terms&quot;</span> * </span></pre></div> </td></tr></table>
bash, drupal, server