Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Convert RoR Project to HAML

haml --rails path/to/app
https://snipt.net/embed/37fee8be8070d6eb2d091b8228f00b33/
https://snipt.net/raw/37fee8be8070d6eb2d091b8228f00b33/
37fee8be8070d6eb2d091b8228f00b33
text
Text only
1
2016-12-05T15:40:47
True
False
False
/api/public/snipt/3370/
convert-ror-project-to-haml
<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>haml --rails path/to/app </span></pre></div> </td></tr></table>
haml

Ruby

Case Statement

1
2
3
4
5
- case parameter
  - when "this"
    do this
  - when "or_this"
    do this
https://snipt.net/embed/a0b3dbe47f948e0dc7f12d5f2d8bc830/
https://snipt.net/raw/a0b3dbe47f948e0dc7f12d5f2d8bc830/
a0b3dbe47f948e0dc7f12d5f2d8bc830
rb
Ruby
5
2016-12-05T15:41:05
True
False
False
/api/public/snipt/1846/
case-statement
<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="o">-</span> <span class="k">case</span> <span class="n">parameter</span> </span><span id="L-2"><a name="L-2"></a> <span class="o">-</span> <span class="k">when</span> <span class="s2">&quot;this&quot;</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">do</span> <span class="n">this</span> </span><span id="L-4"><a name="L-4"></a> <span class="o">-</span> <span class="k">when</span> <span class="s2">&quot;or_this&quot;</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">do</span> <span class="n">this</span> </span></pre></div> </td></tr></table>
haml, ruby

Text only

HTML2HAML

1
2
3
4
5
6
find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}'

find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \
bash
https://snipt.net/embed/7ffab0cebf9c1705699b3e330818532c/
https://snipt.net/raw/7ffab0cebf9c1705699b3e330818532c/
7ffab0cebf9c1705699b3e330818532c
text
Text only
7
2016-12-04T05:00:55
True
False
False
/api/public/snipt/1361/
html2haml
<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>find . -name &#39;*erb&#39; | \ </span><span id="L-2"><a name="L-2"></a>xargs ruby -e &#39;ARGV.each { |i| puts &quot;html2haml -r #{i} #{i.sub(/erb$/,&quot;haml&quot;)}&quot;}&#39; </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>find . -name &#39;*erb&#39; | \ </span><span id="L-5"><a name="L-5"></a>xargs ruby -e &#39;ARGV.each { |i| puts &quot;html2haml -r #{i} #{i.sub(/erb$/,&quot;haml&quot;)}&quot;}&#39; | \ </span><span id="L-6"><a name="L-6"></a>bash </span></pre></div> </td></tr></table>
haml
Copyrighted, illegal, or inappropriate content? Email [email protected].