snipt

Ctrl+h for KB shortcuts

Bash

List all npm versions for a package

npm view [<@scope>/]<package> time
https://snipt.net/embed/d170797a6d229963bc80c47573a7de66/
/raw/d170797a6d229963bc80c47573a7de66/
d170797a6d229963bc80c47573a7de66
bash
Bash
1
2019-06-19T04:57:57
True
False
False
/api/public/snipt/147548/
list-all-npm-versions-for-a-package
<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>npm view <span class="o">[</span>&lt;@scope&gt;/<span class="o">]</span>&lt;package&gt; <span class="nb">time</span> </span></pre></div> </td></tr></table>
javascript, node.js, npm

Bash

Mac OSX Environment Variable For GUI apps

1
2
3
# To set ENV variables for GUI apps, use `launchctl setenv`
export YOUR_VAR="Hello World!"
launchctl setenv YOUR_VAR $YOUR_VAR
https://snipt.net/embed/473e39fae887f52ae1ac675720b86b8f/
/raw/473e39fae887f52ae1ac675720b86b8f/
473e39fae887f52ae1ac675720b86b8f
bash
Bash
4
2019-06-18T18:45:16
True
False
False
May 24, 2015 at 07:25 AM
/api/public/snipt/139576/
mac-osx-environment-variable-for-gui-apps-7347322b
<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="c1"># To set ENV variables for GUI apps, use `launchctl setenv`</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">export</span> <span class="nv">YOUR_VAR</span><span class="o">=</span><span class="s2">&quot;Hello World!&quot;</span> </span><span id="L-3"><a name="L-3"></a>launchctl setenv YOUR_VAR <span class="nv">$YOUR_VAR</span> </span></pre></div> </td></tr></table>
env, osx, shell

Bash

Useful bash command snippets

1
2
3
4
5
6
# Clean all dirs that have mvn builds in them to 
# recover space taken up by /target dirs that are not used
for foo in *; do cd $foo; mvn clean; cd ..; done

# clean all SNAPSHOT items from the local maven repo
cd .m2/repository && find . -name '*-SNAPSHOT' -print0 | xargs -0 rm -rf
https://snipt.net/embed/b52b012c361bfbb20511292c266400c9/
/raw/b52b012c361bfbb20511292c266400c9/
b52b012c361bfbb20511292c266400c9
bash
Bash
6
2019-06-18T07:01:16
True
False
False
/api/public/snipt/136637/
useful-bash-command-snippets-3c6e6349
<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> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Clean all dirs that have mvn builds in them to </span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># recover space taken up by /target dirs that are not used</span> </span><span id="L-3"><a name="L-3"></a><span class="k">for</span> foo in *<span class="p">;</span> <span class="k">do</span> <span class="nb">cd</span> <span class="nv">$foo</span><span class="p">;</span> mvn clean<span class="p">;</span> <span class="nb">cd</span> ..<span class="p">;</span> <span class="k">done</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># clean all SNAPSHOT items from the local maven repo</span> </span><span id="L-6"><a name="L-6"></a><span class="nb">cd</span> .m2/repository <span class="o">&amp;&amp;</span> find . -name <span class="s1">&#39;*-SNAPSHOT&#39;</span> -print0 <span class="p">|</span> xargs -0 rm -rf </span></pre></div> </td></tr></table>
bash, cleanup, maven, shell