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
require 'net/http' | |
require 'uri' | |
require 'cgi' | |
text = "<html><head><title>Delicious2Google</title></head><body>" + | |
"<h1>Upload</h1>" + | |
"<form action='https://www.google.com/bookmarks/mark?op=upload&zx=#{rand(65535)}' method='POST'>" + | |
"<input type='submit'/><input type='hidden' id='data'></form>" + | |
"<textarea id='xml' style='display:none'>\n<bookmarks>\n" |
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
#! /usr/bin/env ruby | |
# Usage: | |
# 1. install ruby and wget if you don't have | |
# 2. gem install nokogiri | |
# 3. mkdir pics, put this script into it | |
# 4. ruby batch_down_pics.rb | |
# (or chmod +x batch_down_pics.rb && ./batch_down_pics.rb) | |
# | |
# WARN: 18+ content! |
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
#!/usr/bin/env ruby | |
$KCODE = 'UTF8' | |
require 'rubygems' | |
require 'hpricot' | |
require 'fileutils' | |
require 'builder' | |
=begin | |
def print_tree(ul, level) | |
ul.search("/li").each do |li| |
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
require 'fileutils' | |
exit if ARGV[0].nil? | |
FileUtils.cd ARGV[0] do |variable| | |
# html 2 xhtml | |
FileUtils.cd "OEBPS" do | |
Dir["*.html"].each do |file| | |
system("tidy -asxhtml --output-encoding utf8 --indent 1 --escape-cdata 1 --drop-proprietary-attributes 1 --drop-font-tags 1 #{file} > #{file}.xml 2> /dev/null") |
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 Fix download | |
// @namespace http://venj.me/greasemonkey/ | |
// @description Fix an error in non-IE browsers. | |
// @include http://www.downloadindex.info/Get.asp?Id=* | |
function secBoard2(n) { | |
return function () { | |
var mainTable = document.getElementById("mainTable"); | |
var secTable = document.getElementById("secTable"); | |
for(i=0;i<secTable.tBodies[0].rows[0].cells.length;i++) |
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
#!/usr/bin/env ruby | |
# encoding=utf-8 | |
# | |
# Usage: ruby down_manga.rb folder_to_hold_manga image_index_url | |
# folder_to_hold_manga is a non-existing folder in current directory to save images. | |
# image_index_url is the index for manga, like: http://manhua.178.com/wangxiangxueshenghui/ | |
# | |
# Need ruby 1.9 and hpricot gem. | |
# |
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
venj@iMacBook ~ » brew update | |
From http://github.com/mxcl/homebrew | |
* branch master -> FETCH_HEAD | |
Already up-to-date. | |
venj@iMacBook ~ » brew install -v go | |
/usr/local/bin/hg | |
==> Cloning http://go.googlecode.com/hg/ | |
Updating /Users/venj/Library/Caches/Homebrew/go--hg | |
hg pull | |
pulling from http://go.googlecode.com/hg/ |
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
#!/usr/bin/env ruby | |
# Usage: clean_url_files.rb path_to_clean | |
require 'fileutils' | |
exit if (ARGV[0].nil? || File.exists?(ARGV[0])) | |
FileUtils.cd(ARGV[0]) do | |
files = Dir["**/*"] | |
files.each do |file| |
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
#:~/.config/google-chrome/Default/Preferences | |
# 或 ~/.config/Chromium/Default/Preferences | |
#在此文件中修改最后一段如下: | |
"webkit": { | |
"webprefs": { | |
"default_fixed_font_size": 16, | |
"default_font_size": 16, | |
"fixed_font_family": "DejaVu Sans Mono", | |
"minimum_font_size": 12, |
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
msgid "" | |
msgstr "Content-Type: text/plain; charset=UTF-8" | |
#: u_translation.rsedit | |
msgid "Edit" | |
msgstr "编辑" | |
#: u_translation.rshelp_prefix | |
msgid "UK" | |
msgstr "英国" |
OlderNewer