Skip to content

Instantly share code, notes, and snippets.

@UskeS
Created August 23, 2018 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UskeS/33a628906b749c1adca18eaf96aad5c8 to your computer and use it in GitHub Desktop.
Save UskeS/33a628906b749c1adca18eaf96aad5c8 to your computer and use it in GitHub Desktop.
[clipMenu] GitHubのCopy pathボタンから得られたパスをブログ用gist-itパスに変換
/**
* ClipMenu用スクリプト
* gist-itのパス表現はここを参照した
* http://ryoichi0102.hatenablog.com/entry/2015/11/13/091803
* 適当に書き換えて使ってください
*/
clipText = clipText.trim();
var myPath = clipText.split("/");
var txt = '<script src="http://gist-it.appspot.com/http://github.com/[user]/'; //[user]の部分がユーザー名
txt += myPath.shift();
txt += "/blob/master/";
txt += myPath.join("/") + '"></script>';
return txt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment