Nishanth Shanmugham http://localhost:1313/ Recent content on Nishanth Shanmugham Hugo -- gohugo.io en-US Tue, 25 Aug 2015 17:09:14 -0500 Use @ instead of HEAD http://localhost:1313/posts/use-at-instead-of-head/ Tue, 25 Aug 2015 17:09:14 -0500 http://localhost:1313/posts/use-at-instead-of-head/ <p>I recently discovered that from git version <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.5.txt#L100">1.8.5</a> onwards, <code>@</code> can replace <code>HEAD</code>:</p> <p><div class="highlight"><pre><span class="nv">$ </span>git reset --hard @~2 <span class="nv">$ </span>git rebase -i @~10 <span class="nv">$ </span>git diff @~2..@~3 </pre></div> </p> <p>And also in most scenarios <code>HEAD</code> can be left out completely, so you can say:</p> <p><div class="highlight"><pre><span class="nv">$ </span>git reset -- @<span class="o">{</span>2<span class="o">}</span> </pre></div> </p> <p>instead of:</p> <p><div class="highlight"><pre><span class="nv">$ </span>git reset -- HEAD@<span class="o">{</span>2<span class="o">}</span> </pre></div> </p> <p>It takes some getting used to, but it&rsquo;s definitely faster than typing <code>HEAD</code>.</p> Redirect webpages using HTML http://localhost:1313/posts/redirect-webpages-html/ Sat, 22 Aug 2015 15:45:30 -0700 http://localhost:1313/posts/redirect-webpages-html/ <p>Webpage redirection is great for automatically redirecting people visiting an old URL to a new URL where the content has moved to. It can be done using JavaScript, but there is also a convenient HTML-only solution.</p> <p>To redirect visitors reaching <code>yourwebsite.com/blog</code> to <code>yourwebsite.com/posts</code>, add this to the <code>&lt;head&gt;</code> section of the HTML at <code>yourwebsite.com/blog</code>:</p> <p><div class="highlight"><pre><span class="nt">&lt;meta</span> <span class="na">http-equiv=</span><span class="s">&quot;refresh&quot;</span> <span class="na">content=</span><span class="s">&quot;0;url=&#39;/posts&#39;&quot;</span> <span class="nt">/&gt;</span> <span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">&quot;canonical&quot;</span> <span class="na">href=</span><span class="s">&quot;/posts&quot;</span> <span class="nt">/&gt;</span> </pre></div> </p> <h3 id="walkthrough:afdc852818bb97af4efb4d34b2fcce3b">walkthrough</h3> <p>Setting <code>http-equiv=&quot;refresh&quot;</code> in the first line performs the actual redirect. The number in the <code>content</code> attribute specified in seconds tells the browser how long to wait before redirecting. In this example, <code>0</code> redirects immediately. Increasing the wait may be useful for briefly displaying a 404 page before automatically switching to the home page. The <code>url</code> specfies the destination for the redirect. In this example, we wanted to switch to <code>/posts</code>.</p> <p>The second line is optional; it helps search engines know which the preferred version of the page is. Usually, this is the redirect destination.</p> About http://localhost:1313/about/ Sat, 22 Aug 2015 06:42:21 -0700 http://localhost:1313/about/ <p>I&rsquo;m a software engineer and student at UT Austin. I primarily program in JavaScript. I currently work at Evernote. I also teach a web development class as part of <a href="//cs.utexas.edu/users/mad">MAD</a>, a computer science campus organization.</p> <p>I love soccer and mediterranean food. You can find recent open source work on <a target="_blank" href="//github.com/nishanths">GitHub</a>.</p> <p>Please feel free to get in touch at <a href="mailto:nishanths@utexas.edu">nishanths@utexas.edu</a>.</p> <p><img src="//s.gravatar.com/avatar/9e766e4880d9a79fd1244c1b04dc31fe?size=4096&default=retro" class="profile"></p> <p><br /></p> <p><a href="colophon/">About this site</a></p> colophon http://localhost:1313/colophon/ Sat, 22 Aug 2015 06:28:26 -0700 http://localhost:1313/colophon/ <p>This website is the place where I write about JavaScript, git, and tech. It is also a personal homepage.</p> <p>The site is built with <a target="_blank" href="//gohugo.io">Hugo</a>—a static site generator made with Go and is hosted on GitHub Pages. The website <a target="_blank" href="//github.com/nishanths/nishanths.me">source code</a> is available on GitHub. It uses the <a target="_blank" href="//github.com/nishanths/cocoa-hugo-theme">cocoa</a> theme. The posts are written in Markdown.</p> <p>The primary font face is Proxima Nova and the monospace font face is Ubuntu Mono. The social icons are from the Ionicons font set. CSS classes for code syntax highlighting are inserted during compile-time by Hugo using Pygments.</p> <p>If you find errors, <a href="https://github.com/nishanths/nishanths.me/issues/new">please let me know</a>.</p> Code http://localhost:1313/code/ Wed, 19 Aug 2015 20:29:37 -0700 http://localhost:1313/code/ <ul> <li><a href="https://github.com/nishanths/iterators.js">iterators.js</a>: Useful functional iterators for node and the browser</li> <li><a href="https://github.com/nishanths/spitfire-live">Spitfire</a>: HackTX 2015, Winner – a real-time rhyming assistant</li> <li><a href="https://github.com/nishanths/markdown-viewer-component">markdown-viewer-component</a>: Web Component that renders Markdown placed inside an element as HTML</li> <li><a href="https://github.com/nishanths/cocoa-hugo-theme">cocoa-hugo-theme</a>: Distraction-free reading theme for Hugo, the static site generator</li> <li><a href="https://github.com/nishanths/slack-texts">slack-texts</a>: Important channel messages also sent to your phone via SMS</li> <li><a href="https://github.com/nishanths/YWeatherAPI">YWeatherAPI</a>: Powerful Yahoo! Weather API wrapper for Mac and iOS</li> <li><a href="https://github.com/utcsmad/umad-website-2015">uMAD 2015</a>: Website for the student developer conference built with Middleman</li> <li><a href="https://github.com/nishanths/what-s-playing">What&rsquo;s Playing</a>: Desktop notifications for online music playback changes</li> <li><a href="https://github.com/nishanths/QuickCal">QuickCal</a>: Highlight and add dates from any website to Google Calendar</li> <li><a href="https://github.com/nishanths/youtube-pause-chrome">YouTube Pause</a>: Spacebar pauses the video instead of scrolling down the page. <a href="http://www.cnet.com/how-to/chrome-pause-youtube-videos-with-the-spacebar/">CNET</a></li> <li><a href="https://duckduckgo.com/?q=ISBN+number+0-06-250217-4&amp;ia=books">ISBN Search</a>: DuckDuckGo module to lookup book information by ISBN</li> <li><a href="https://duckduckgo.com/?q=html+encode+the+paragraph+sign&amp;ia=answer">HTML Entities Encoder &amp;</a> <a href="https://duckduckgo.com/?q=decoded+html+for+%26%23x00a5%3B&amp;ia=answer">Decoder</a>: Encode and decode HTML entities on DuckDuckGo using natural queries</li> <li><a href="https://github.com/nishanths/auto-browser">Auto-Browser</a>: HackTX 2014, Top 10</li> </ul> http://localhost:1313/about-this-site/ Mon, 01 Jan 0001 00:00:00 +0000 http://localhost:1313/about-this-site/ <!DOCTYPE html> <html> <head> <link rel="canonical" href="http://localhost:1313/colophon"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="refresh" content="0;url=/colophon"/> </head> </html> http://localhost:1313/blog/ Mon, 01 Jan 0001 00:00:00 +0000 http://localhost:1313/blog/ <!DOCTYPE html> <html> <head> <link rel="canonical" href="http://localhost:1313/posts"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="refresh" content="0;url=/posts"/> </head> </html> http://localhost:1313/projects/ Mon, 01 Jan 0001 00:00:00 +0000 http://localhost:1313/projects/ <!DOCTYPE html> <html> <head> <link rel="canonical" href="http://localhost:1313/code"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="refresh" content="0;url=/code"/> </head> </html> http://localhost:1313/resume/ Mon, 01 Jan 0001 00:00:00 +0000 http://localhost:1313/resume/ <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="refresh" content="0;url=//cl.ly/0v2m3E0c0p2t/shanmugham-resume.pdf"/> </head> </html> http://localhost:1313/writing/ Mon, 01 Jan 0001 00:00:00 +0000 http://localhost:1313/writing/ <!DOCTYPE html> <html> <head> <link rel="canonical" href="http://localhost:1313/posts"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="refresh" content="0;url=/posts"/> </head> </html>