I’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 MAD, a computer science campus organization.
- -I love soccer and mediterranean food. You can find recent open source work on GitHub.
- -Please feel free to get in touch at nishanths@utexas.edu.
- -This website is the place where I write about JavaScript, git, and tech. It is also a personal homepage.
- -The site is built with Hugo—a static site generator made with Go and is hosted on GitHub Pages. The website source code is available on GitHub. It uses the cocoa theme. The posts are written in Markdown.
- -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.
- -If you find errors, please let me know.
- -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.
- -To redirect visitors reaching yourwebsite.com/blog
to yourwebsite.com/posts
, add this to the <head>
section of the HTML at yourwebsite.com/blog
:
<meta http-equiv="refresh" content="0;url='/posts'" />
-<link rel="canonical" href="/posts" />
-
Setting http-equiv="refresh"
in the first line performs the actual redirect. The number in the content
attribute specified in seconds tells the browser how long to wait before redirecting. In this example, 0
redirects immediately. Increasing the wait may be useful for briefly displaying a 404 page before automatically switching to the home page. The url
specfies the destination for the redirect. In this example, we wanted to switch to /posts
.
The second line is optional; it helps search engines know which the preferred version of the page is. Usually, this is the redirect destination.
- -I recently discovered that from git version 1.8.5 onwards, @
can replace HEAD
:
$ git reset --hard @~2
-$ git rebase -i @~10
-$ git diff @~2..@~3
-
And also in most scenarios HEAD
can be left out completely, so you can say:
$ git reset -- @{2}
-
instead of:
- -$ git reset -- HEAD@{2}
-
It takes some getting used to, but it’s definitely faster than typing HEAD
.