Skip to content

Instantly share code, notes, and snippets.

View xiaoda's full-sized avatar

Lynch Tai xiaoda

View GitHub Profile
// ==UserScript==
// @name Re-enable password pasting
// @namespace http://yechengfu.com
// @version 0.1
// @description Re-enable password pasting.
// @author Yecheng Fu
// @match https://accounts.ctrip.com/*
// @grant none
// @refer http://prioritized.net/blog/re-enabling-password-pasting-on-annoying-web-forms/
// ==/UserScript==
@xiaoda
xiaoda / tieba_list_pics.js
Created January 27, 2016 07:19 — forked from wudi/tieba_list_pics.js
Show 贴吧图片
javascript:!function() { document.getElementsByTagName('body')[0].scrollTop = 0; $('.search_bright').remove(); $('#com_userbar').remove(); $('#tbui_aside_float_bar').remove(); var posts_urls = []; var posts_title = []; var nodes = $('.j_thread_list .threadlist_title .j_th_tit'); $(nodes).each(function(e){ posts_urls.push($(nodes[e]).attr('href')); posts_title.push($(nodes[e]).text()); }); console.log(posts_urls); $('#pending').remove(); $('html>body').prepend('<center id="pending"><h1 style="color:red;">%E5%A4%84%E7%90%86%E4%B8%AD...</h1></center>'); function loadCss(css_url) { var link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = css_url; document.getElementsByTagName("head")[0].appendChild(link); } loadCss('//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css'); loadCss('//blueimp.github.io/Gallery/css/blueimp-gallery.min.css'); $.getScript('//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.js'); $.getScript('//7xiam0.com1.z0.glb.clouddn.com/jquery.blue
function loadScript(url, callback) {
var script = document.createElement('script');
script.type = 'text/javascript';
if (script.readyState) { // IE
script.onreadystatechange = function() {
if(script.readyState == 'loaded' || script.readyState == 'complete'){
script.onreadystatechange = null;
callback();
}
}
var wark_the_DOM = function walk(node, func) {
func(node);
node = node.firstChild;
while (node) {
walk(node, func);
node = node.nextSibling;
}
}
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
}
Function.method('curry', function () {
var slice = Array.prototype.slice,
args = slice.apply(arguments),
that = this;
return function () {
var is_array = function (value) {
return Object.prototype.toString.apply(value) === '[object Array]';
}
@xiaoda
xiaoda / auto_forced_wrap.css
Created February 28, 2016 15:00
css实现强制不换行/自动换行/强制换行
/* 强制不换行 */
div{
white-space: nowrap;
}
/* 自动换行 */
div{
word-wrap: break-word;
word-break: normal;
}
@xiaoda
xiaoda / baidu-as-a-network-utility.css
Created May 15, 2016 12:54 — forked from tianyuf/baidu-as-a-network-utility.css
BaaN: Baidu as a Network Utility - 百度的实用主义方法论.
@-moz-document domain("baidu.com") {
body {
display: none;
}
html {
margin: 30px;
}
html::after {
[alias]
co = checkout
ci = commit
br = branch
st = status
[user]
name = xiaoda
email = [email protected]
[color]
status = auto
{
"binary_file_patterns":
[
"node_modules/*",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",