snipt

Ctrl+h for KB shortcuts

Bash

set Grails path

export GRAILS_HOME="/opt/local/share/java/grails"
https://snipt.net/embed/de455c9de7396f3f263ea27dc2c76a3b/
/raw/de455c9de7396f3f263ea27dc2c76a3b/
de455c9de7396f3f263ea27dc2c76a3b
bash
Bash
1
2019-05-20T16:40:09
True
False
False
/api/public/snipt/3595/
set-grails-path
<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="nb">export</span> <span class="nv">GRAILS_HOME</span><span class="o">=</span><span class="s2">&quot;/opt/local/share/java/grails&quot;</span> </span></pre></div> </td></tr></table>
bash, grails

Bash

run Grails app on specific port

## change 9090 to whatever available port you want to use
grails -Dserver.port=9090 run-app
https://snipt.net/embed/add373743b3b906ec2bf73ed6a29eafb/
/raw/add373743b3b906ec2bf73ed6a29eafb/
add373743b3b906ec2bf73ed6a29eafb
bash
Bash
2
2019-05-22T22:48:15
True
False
False
/api/public/snipt/3594/
run-grails-app-on-specific-port
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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">## change 9090 to whatever available port you want to use</span> </span><span id="L-2"><a name="L-2"></a>grails -Dserver.port<span class="o">=</span><span class="m">9090</span> run-app </span></pre></div> </td></tr></table>
bash, grails, port

Ruby

current year for copyright

1
2
3
4
5
6
&copy; Copyright <%= current_year -%>.

## Add to application helper
def current_year
    Time.now.strftime('%Y')
end
https://snipt.net/embed/8e3f25eeb97c3ae023e9c85afc74ff8a/
/raw/8e3f25eeb97c3ae023e9c85afc74ff8a/
8e3f25eeb97c3ae023e9c85afc74ff8a
rb
Ruby
7
2019-05-21T18:42:13
True
False
False
/api/public/snipt/2705/
current-year-for-copyright
<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="o">&amp;</span><span class="n">copy</span><span class="p">;</span> <span class="no">Copyright</span> <span class="o">&lt;%=</span> <span class="n">current_year</span> <span class="o">-%&gt;.</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">## Add to application helper</span> </span><span id="L-4"><a name="L-4"></a><span class="k">def</span> <span class="nf">current_year</span> </span><span id="L-5"><a name="L-5"></a> <span class="no">Time</span><span class="o">.</span><span class="n">now</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y&#39;</span><span class="p">)</span> </span><span id="L-6"><a name="L-6"></a><span class="k">end</span> </span></pre></div> </td></tr></table>
rails, ruby, year

Bash

Change working copy svn url

## CD into working copy directory and use the full url (ie SVN+SSH:// ...)
svn switch --relocate OLD_REPO_URL NEW_REPO_URL
https://snipt.net/embed/c3b9955dcf030c318e36ed95a044f035/
/raw/c3b9955dcf030c318e36ed95a044f035/
c3b9955dcf030c318e36ed95a044f035
bash
Bash
2
2019-05-20T16:44:01
True
False
False
/api/public/snipt/2449/
change-working-copy-svn-url
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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">## CD into working copy directory and use the full url (ie SVN+SSH:// ...)</span> </span><span id="L-2"><a name="L-2"></a>svn switch --relocate OLD_REPO_URL NEW_REPO_URL </span></pre></div> </td></tr></table>
bash, svn, url