#如何成为黑客 How To Become A Hacker
Eric Steven Raymond, Thyrsus Enterprises, < [email protected] >
翻译:柯非, < [email protected] >
这篇译文基于2014.05.20更新的原文修订版1.47。
namespace :image_compression do | |
desc 'Optimize images with optipng and jpegoptim' | |
task :process do | |
# Check for optipng | |
if (!`which optipng`.empty? rescue false) # rescue on environments without `which` (windows) | |
# Crush all .png files inplace | |
run "find #{shared_path}/assets/ -type f -name '*.png' -print0 | xargs -0 optipng -quiet -o7 " | |
else |
#如何成为黑客 How To Become A Hacker
Eric Steven Raymond, Thyrsus Enterprises, < [email protected] >
翻译:柯非, < [email protected] >
这篇译文基于2014.05.20更新的原文修订版1.47。
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
# for Pry binding references | |
# | |
# Installation | |
# | |
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
# | |
# Based on | |
# | |
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/ |
# | |
# Notes: | |
# | |
# I used the following AMI: | |
# "Amazon Linux AMI 2015.09.1 (HVM), SSD Volume Type - ami-60b6c60a" | |
# Running on AMI: amzn-ami-hvm-2015.09.1.x86_64-gp2 (ami-60b6c60a) | |
# | |
# You probably want to use an instance type with a large amount of memory. My first | |
# attempt was with a c4.2xlarge but it rant out of memory without using -j option to | |
# limit the parallel build. |
The following instructions are heavily inspired by /u/uhohohdear. I modified uhohohdear's instructions and then added support for Retina/HiDPI displays and instructions about how to update MTGA.
#!/usr/bin/env ruby | |
print "What is the URL of your Apple Downloads resource?\nURL:" | |
url = gets.strip | |
print "What is the ADCDownloadAuth cookie token:\nADCDownloadAuth: " | |
token = gets.strip | |
command = "aria2c --header \"Host: adcdownload.apple.com\" --header \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" --header \"Upgrade-Insecure-Requests: 1\" --header \"Cookie: ADCDownloadAuth=#{token}\" --header \"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1\" --header \"Accept-Language: en-us\" -x 16 -s 16 #{url} -d ~/Downloads" |