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
# pip install PyMuPDF | |
# usage: python merge.py input_file.pdf | |
import sys | |
import fitz | |
def merge_pages(input_file, output_file): | |
with fitz.open(input_file) as doc: |
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
# Turn On | |
networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 7070 | |
networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 7070 | |
networksetup -setsocksfirewallproxystate Wi-Fi on | |
networksetup -setsocksfirewallproxystate Ethernet on | |
# Turn Off | |
networksetup -setsocksfirewallproxystate Wi-Fi off | |
networksetup -setsocksfirewallproxystate Ethernet off |
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
http://devstreaming.apple.com/videos/wwdc/2013/400xex2xbskwa5bkxr17zihju9uf/400/400-HD.mov?dl=1 | |
dir=~/Downloads/WWDC 2013/Tools/ | |
out=Session 400 - What’s New in Xcode 5.mov | |
http://devstreaming.apple.com/videos/wwdc/2013/400xex2xbskwa5bkxr17zihju9uf/400/400.pdf?dl=1 | |
dir=~/Downloads/WWDC 2013/Tools/ | |
out=Session 400 - What’s New in Xcode 5.pdf | |
http://devstreaming.apple.com/videos/wwdc/2013/401xbx2xq50gv7mqafyfdns2yhxl/401/401-HD.mov?dl=1 | |
dir=~/Downloads/WWDC 2013/Tools/ | |
out=Session 401 - Xcode Core Concepts.mov | |
http://devstreaming.apple.com/videos/wwdc/2013/401xbx2xq50gv7mqafyfdns2yhxl/401/401.pdf?dl=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
"============================================================================ | |
"File: rubocop.vim | |
"Description: rubocop checker for syntastic.vim | |
"Author: mybeky <mybeky at gmail.com> | |
" | |
"============================================================================ | |
if exists("g:loaded_syntastic_ruby_robocop_checker") | |
finish | |
endif | |
let g:loaded_syntastic_ruby_robocop_checker=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
function FindProxyForURL(url, host) | |
{ | |
var resolved_ip = dnsResolve(host); | |
if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") || | |
isInNet(resolved_ip, "172.16.0.0", "255.240.0.0") || | |
isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") || | |
isInNet(resolved_ip, "127.0.0.0", "255.255.255.0")) | |
return "DIRECT"; |
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
# Install https://github.com/rg3/youtube-dl/ first. | |
youtube-dl http://www.youtube.com/playlist\?list\=PLC0B137D835A3C970 -l --max-quality mp4 |
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
# Create symbolic link first. | |
# ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush ~/bin/ | |
# or | |
# ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush ~/bin/ | |
# for old version Xcode. | |
find . -depth 1 -name '*.png' -exec pngcrush -revert-iphone-optimizations {} {}-o.png \; |
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 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'https://vim.googlecode.com/hg/', :revision => '2d107086903a' | |
version '7.3.584' | |
def install | |
system "./configure", | |
"--with-features=huge", |
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
tell application "MacVim" | |
set window_title to name of window 1 | |
set is_empty to offset of "[NO NAME]" in window_title | |
if is_empty is 0 then | |
set cwd to do shell script "echo '" & window_title & "' |sed 's/.* (\\(.*\\)).*/\\1/'" | |
tell application "iTerm" | |
make new terminal | |
tell the current terminal | |
activate current session | |
launch session "Default Session" |
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
diff --git a/lixian.py b/lixian.py | |
index 05331e4..7139f51 100644 | |
--- a/lixian.py | |
+++ b/lixian.py | |
@@ -37,7 +37,7 @@ class XunleiClient: | |
def urlopen(self, url, **args): | |
#print url | |
if 'data' in args and type(args['data']) == dict: | |
- args['data'] = urllib.urlencode(args['data']) | |
+ args['data'] = urllib.urlencode(dict([k, unicode(v).encode('utf-8')] for k, v in args['data'].items())) |
NewerOlder