Gi+ git clone

  • /*
     * @title Gi+ git clone
     * @description append ssh-protocol for clone on Gist
     * @include https://gist.github.com/*
     * @contributor xtetsuji  http://let.hatelabo.jp/xtetsuji/let/hJmcxdPpvrF- (Fork of)
     * @contributor noromanba http://let.hatelabo.jp/noromanba/let/hJmcxq3wlKcE
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    (function () {
      var id = (location.pathname.match(/\/.*\/(\w+)/) || [])[1],
          parent = document.querySelector('.export-references');
      if (!id || !parent) return;
    
      var container = document.createElement('li');
    
      var label = document.createElement('label');
      var what = document.createElement('strong');
      what.textContent = 'Git Clone';
      label.appendChild(what);
      label.appendChild(document.createTextNode(' this gist'));
      container.appendChild(label);
    
      var gc = document.createElement('input');
      gc.type = 'text';
      gc.readOnly = true;
      gc.spellcheck = false;
      gc.className = 'url-field js-url-field';
      gc.name = 'x-git-clone-field';
      gc.value = 'git clone git@github.com:' + id + '.git'; // TBD git://
      container.appendChild(gc);
    
      parent.appendChild(container);
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/11/08 00:29:45 - 2013-11-08
  2. 2013/11/07 23:42:27 - 2013-11-07
  3. 2013/11/07 23:01:20 - 2013-11-07