snipt

Ctrl+h for KB shortcuts

Text only

TMux configuration options

# Set mouse scroll buffer on TMux/Mac
setw -g mode-mouse on      
https://snipt.net/embed/eea9b9a01443f1a5c318574c26172edf/
/raw/eea9b9a01443f1a5c318574c26172edf/
eea9b9a01443f1a5c318574c26172edf
text
Text only
3
2019-06-16T15:52:48
True
False
False
Oct 24, 2016 at 12:15 PM
/api/public/snipt/148053/
tmux-configuration-options
<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># Set mouse scroll buffer on TMux/Mac </span><span id="L-2"><a name="L-2"></a>setw -g mode-mouse on </span></pre></div> </td></tr></table>

Ruby

String to UUID format (Ruby)

1
2
3
4
5
6
7
class String
  def to_uuid_format
    s = self.gsub(/[^a-fA-F0-9]/, '')
    s = s + ("0" * (32 - s.length))
    "#{s[0..7]}-#{s[8..11]}-#{s[12..15]}-#{s[16..19]}-#{s[20..31]}"
  end
end
https://snipt.net/embed/e8ccc668e24bcf379167db80ec03f91f/
/raw/e8ccc668e24bcf379167db80ec03f91f/
e8ccc668e24bcf379167db80ec03f91f
rb
Ruby
8
2019-06-14T12:57:54
True
False
False
Sep 09, 2016 at 03:19 PM
/api/public/snipt/147728/
string-to-uuid-format-ruby
<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> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">class</span> <span class="nc">String</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">def</span> <span class="nf">to_uuid_format</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">s</span> <span class="o">=</span> <span class="nb">self</span><span class="o">.</span><span class="n">gsub</span><span class="p">(</span><span class="sr">/[^a-fA-F0-9]/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">s</span> <span class="o">=</span> <span class="n">s</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;0&quot;</span> <span class="o">*</span> <span class="p">(</span><span class="mi">32</span> <span class="o">-</span> <span class="n">s</span><span class="o">.</span><span class="n">length</span><span class="p">))</span> </span><span id="L-5"><a name="L-5"></a> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">s</span><span class="o">[</span><span class="mi">0</span><span class="o">..</span><span class="mi">7</span><span class="o">]</span><span class="si">}</span><span class="s2">-</span><span class="si">#{</span><span class="n">s</span><span class="o">[</span><span class="mi">8</span><span class="o">..</span><span class="mi">11</span><span class="o">]</span><span class="si">}</span><span class="s2">-</span><span class="si">#{</span><span class="n">s</span><span class="o">[</span><span class="mi">12</span><span class="o">..</span><span class="mi">15</span><span class="o">]</span><span class="si">}</span><span class="s2">-</span><span class="si">#{</span><span class="n">s</span><span class="o">[</span><span class="mi">16</span><span class="o">..</span><span class="mi">19</span><span class="o">]</span><span class="si">}</span><span class="s2">-</span><span class="si">#{</span><span class="n">s</span><span class="o">[</span><span class="mi">20</span><span class="o">..</span><span class="mi">31</span><span class="o">]</span><span class="si">}</span><span class="s2">&quot;</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">end</span> </span><span id="L-7"><a name="L-7"></a><span class="k">end</span> </span></pre></div> </td></tr></table>

Text only

Chrome Javascript open webpage in new window with no decoration

Add the following to the bookmark URL text:
javascript:(function(){window.open("https://app.nozbe.com/#na","_blank","status=0,titlebar=0,toolbar=0,height=300,width=300");})()
https://snipt.net/embed/bac04a042e68519c75bf78535385948f/
/raw/bac04a042e68519c75bf78535385948f/
bac04a042e68519c75bf78535385948f
text
Text only
2
2019-06-15T01:27:49
True
False
False
Aug 17, 2016 at 01:03 PM
/api/public/snipt/147587/
chrome-javascript-open-webpage-in-new-window-with-no-decoration
<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>Add the following to the bookmark URL text: </span><span id="L-2"><a name="L-2"></a>javascript:(function(){window.open(&quot;https://app.nozbe.com/#na&quot;,&quot;_blank&quot;,&quot;status=0,titlebar=0,toolbar=0,height=300,width=300&quot;);})() </span></pre></div> </td></tr></table>

Bash

AWK timestamp each line

<cmd> | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
https://snipt.net/embed/3c95a0173f04f01070d3df97f8aa825b/
/raw/3c95a0173f04f01070d3df97f8aa825b/
3c95a0173f04f01070d3df97f8aa825b
bash
Bash
1
2019-06-17T04:52:46
True
False
False
Mar 25, 2016 at 06:05 PM
/api/public/snipt/144950/
awk-timestamp-each-line
<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>&lt;cmd&gt; <span class="p">|</span> awk <span class="s1">&#39;{ print strftime(&quot;%Y-%m-%d %H:%M:%S&quot;), $0; fflush(); }&#39;</span> </span></pre></div> </td></tr></table>
awk, bash, console, timestamp

Bash

synctex command to open VIM

"C:\Program Files (x86)\Vim\vim73\gvim.exe" --servername tex --remote-send ":e!<CR>:o %f<CR>%lG"
https://snipt.net/embed/e8464e89c2c818bcdac497a99c7a0b3b/
/raw/e8464e89c2c818bcdac497a99c7a0b3b/
e8464e89c2c818bcdac497a99c7a0b3b
bash
Bash
1
2019-06-13T17:33:02
True
False
False
/api/public/snipt/34001/
synctex-command-to-open-vim
<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="s2">&quot;C:\Program Files (x86)\Vim\vim73\gvim.exe&quot;</span> --servername tex --remote-send <span class="s2">&quot;:e!&lt;CR&gt;:o %f&lt;CR&gt;%lG&quot;</span> </span></pre></div> </td></tr></table>
latex, synctex, tex, vim