Blog 1

Random Talk on Random Thoughts

Shortened GitHub URLs for This Site

| Comments |


I want to include a link to a Gist in an Octopress codeblock.


In the syntax for a codeblock, the link is too long. This can cause problems in a graphical frontend of Git, such as gitk.


I found a post about GitHub URL Shortener by accident.

$ curl -i -F "url=" -F "code=vtam"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   293  100    29  100   264     40    367 --:--:-- --:--:-- --:--:--   375HT
TP/1.1 100 Continue

HTTP/1.1 201 Created
Server: Cowboy
Connection: keep-alive
Date: Tue, 10 Jan 2017 22:50:08 GMT
Status: 201 Created
Content-Type: text/html;charset=utf-8
Content-Length: 29
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Runtime: 0.111560
X-Node: 6a832541-d7fa-4b2b-9a4b-1e3355ad0eab
X-Revision: 4fdc60de6311e6a3aa31e19bc7b3aad7e85d33a6
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 vegur

In fact, is much simpler for users who don’t type commands.


I created three short URLs with this tool.

  1. for my GitHub account
  2. for this blog
  3. for Blog 2