This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$('#comments').find('.comment-item').each(function(i) { | |
var page, level, paginator = $('.paginator'); | |
page = paginator.length ? parseInt(paginator.find('.on').text()) : 1; | |
level = i + 1 + (page - 1) * 30; | |
$(this).find('.author').append($('<strong>').text(level + '楼')); | |
}); | |
})(window.jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
yum --enablerepo=remi,remi-php55 install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-apc php-gd php-mbstring php-mcrypt php-xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// javascript:(function(l){var f=function(u,a,b){return u.indexOf(a)?u.replace(a,b):f(u,b,a)};l.herf=f(l.href,'.com','.dev')})(location); | |
(function(l) { | |
var f = function (u, a, b) { | |
return u.indexOf(a) ? u.replace(a, b) : f(u, b, a); | |
}; | |
l.href = f(l.href, '.dev', '.com'); | |
})(location); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function random_text( $type = 'alnum', $length = 8 ) | |
{ | |
switch ( $type ) { | |
case 'alnum': | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; | |
case 'alpha': | |
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(doc) { | |
var API = 'https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=', | |
img = doc.createElement('img'); | |
img.style.cssText = 'position:fixed;top:5px;right:5px;z-index:2147483647'; | |
img.src = API + encodeURI(location.href); | |
img.onclick = function() { | |
img.parentNode.removeChild(img) | |
}; | |
doc.body.appendChild(img) | |
})(document) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, user-scalable=no"> | |
<title>Feed Reader</title> | |
<style> | |
body { font-size: 14px; line-height: 1.3em; } | |
#main { max-width: 768px; margin: auto; } | |
#main-container { padding: 5px; background: #C3D9FF; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(find -name '*.ext'); do | |
encoding=$(file -bi "$i" | sed -e 's/.*[ ]charset=//'); | |
iconv -f $encoding -t UTF-8 -o "$i" "$i"; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 虾米音乐下载 | |
// @namespace tranch | |
// @description 替换下载按钮的链接 | |
// @include http://www.xiami.com/album/* | |
// @include http://www.xiami.com/song/* | |
// @version 0.06 | |
// @grant none | |
// ==/UserScript== | |
(function (d, l) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name block it | |
// @namespace tranch | |
// @description block item by domain on hacknews | |
// @include http://news.dbanotes.net/* | |
// @version 0.1 | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
from urlparse import urlparse, parse_qs | |
def main(script, plate): | |
url = urlparse(plate) | |
query_string = parse_qs(url.query) | |
application = r'D:\Program Files\HeidiSQL\heidisql.exe' | |
command = [application, |
OlderNewer