

















从某时起,Github 和 Linux 一样,开始有着越来越多的 bug 和让人不舒服的地方。本文所附的 GreaseMonkey 脚本修正以下问题:
Google Code 后来也加入了 git 支持,但是我极少使用。为什么呢?因为我讨厌输入用户名和密码!虽然 Github 没有像 Google Code 那样给你生成个随机密码,但这种麻烦且不安全的方式能避免我就决不容忍。你的密码会比密钥还长吗?你使用密钥时需要输入或者显示密钥的内容吗??
// ==UserScript==
// @name github fixes
// @namespace http://lilydjwg.is-programmer.com/
// @description 下载默认 gzip 格式,新建项目时使用 ssh 协议
// @include https://github.com/*
// @version 1.4
// @grant none
// ==/UserScript==
var dl = document.querySelector('[icon_class=octicon-cloud-download]');
if(!dl){
dl = document.querySelector('a[title^=Download]');
}
if(dl){
dl.title = dl.title.replace('zip', 'gzip');
dl.href = dl.href.replace(/archive\/[^\/]+.zip/, 'tarball/master');
var infotext = dl.childNodes[dl.childNodes.length-1];
infotext.textContent = infotext.textContent.replace('ZIP', 'GZIP');
}
var repourl = document.querySelectorAll('.js-live-clone-url');
var re = /https:\/\/github\.com\/([^\/]+)\/(.*)/;
var span, m;
var i, len;
for(i=0, len=repourl.length; i<len; i++){
span = repourl[i];
m = re.exec(span.textContent);
if(m){
span.textContent = 'git@github.com:'+m[1]+'/'+m[2];
}
}
点此安装。
2012年9月9日更新:跟随 github 的更新,修正修改默认下载的格式失败的问题。
2012年11月27日更新:跟随 github 更新,使用带版本号的下载链接地址。
2013年5月17日更新:跟随 github 更新,更新 CSS 选择器。
2013年6月18日更新:支持 新版界面。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。