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 | |
require 'rubygems' | |
require 'colorize' | |
require 'shellwords' | |
Dir["*"].each do |f| | |
next if f == File.basename(__FILE__) | |
fname = File.basename(f.downcase, '.avi') | |
print "Encoding #{f}..." | |
system("ffmpeg -v error -i #{f.shellescape} -map_metadata 0:g -acodec libfaac -ab 256 -ar 44100 -ac 1 -c:v h264 #{fname}.m4v") |
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 | |
require "rubygems" | |
require "rubypython" | |
require "digest" | |
RP = RubyPython | |
RP.start | |
username = ARGV[0] |
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 aotucapcha | |
// @namespace http://218.90.160.85:9090/bustravelguide/default.aspx | |
// @description Auto enter capcha | |
// @include http://218.90.160.85:9090/bustravelguide/default.aspx | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener('DOMContentLoaded', 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
#!/bin/bash | |
REPO_HOME=/home/git | |
CWDDIR=`pwd` | |
function usage() { | |
echo -e "Usage: \e[1;34m`basename $0`\e[0m RepoName1 [RepoName2 ...]" | |
} | |
function createrepo() { |
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
document.addEventListener('DOMContentReady', function(){ | |
// DOM ready. | |
}); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>me.venj.autossh</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/autossh</string> | |
<string>-M</string> |
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
dynamic.cloud.vip.xunlei.com##DIV[class="speac_notice_layer"] | |
t.qq.com##DIV[id="main_cmd_w"][class="main_cmd_w"] | |
t.qq.com##DIV[class="newsTips2 guess"] | |
t.qq.com##DIV[id="app_olypicCheer"][class="SC SC_lst2 SC_olpic_mod"] | |
t.qq.com##DIV[class="SC SC_lst2"] | |
t.qq.com##DIV[class="nv_head_wrap"] | |
t.qq.com##DIV[class="promoWrap"] | |
t.qq.com##DIV[id="oly-ctn2"][class="micro_olympic clear"] | |
t.qq.com##DIV[id="app_olypicCheer"] | |
t.qq.com##DIV[id="app_recStars"] |
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 | |
f = open ARGV[0] | |
o = open "out.strings", "w+" | |
lines = f.readlines | |
lines.each_slice(3) do |para| | |
regex = /\/\* (.*) \*\//i | |
chn = para[0].strip.match(regex)[1] | |
i = para[1].index("=") + 1 |
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
/* | |
用iOS 5的GeoCoder API,反向解析经纬度。代码简略如下: | |
*/ | |
CGFloat lat = 30.0; CGFloat lng = 120.0; | |
CLGeocoder *coder = [[CLGeocoder alloc] init]; | |
CLLocation *mapLocation = [[CLLocation alloc] initWithLatitude:lat longitude:lng]; | |
[coder reverseGeocodeLocation:mapLocation completionHandler:^(NSArray *placemarks, NSError *error) { |
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 | |
TARGET_WIDTH = 1000.0 | |
Dir["*.jpg"].each do |f| | |
fileinfo = `convert #{f} -print "%wx%h" /dev/null` | |
width, height = fileinfo.split("x").collect(&:to_i) | |
height *= (TARGET_WIDTH / width) | |
width = TARGET_WIDTH | |
print "Processing #{f}..." |