77 | 78 |
├── data └── book │ ├── system │ ├── userAccount.md │ ├── userlist.md │ ├── book.mdo │ ├── README.md │ ├── error.html │ ├── logout.html │ ├── booklist.md │ ├── createBook.html │ ├── signup.html │ └── login.html │ ├── ccc │ ├── article.md │ ├── grandpaIphone.md │ ├── HeavenMoney.md │ ├── book.mdo │ ├── js1.md │ ├── codelist.md │ ├── knife.md │ ├── booklist.md │ ├── ChildMagneto.md │ ├── litchi.md │ ├── DrMagneto.md │ ├── archaeology.md │ ├── strongestKongfu.md │ ├── queen.md │ ├── HeavenMoney5.md │ ├── novel.md │ ├── HeavenMoney3.md │ ├── paper.md │ ├── lover.md │ ├── README.md │ ├── chief.md │ ├── course.md │ ├── MonsterWorld.md │ ├── DrMagnetoEnglish.md │ ├── HeavenMoney7.md │ ├── HeavenMoney6.md │ ├── HeavenMoney1.md │ ├── ai1.md │ ├── HeavenMoney4.md │ ├── HeavenMoney2.md │ ├── tako.md │ ├── sc1.md │ ├── assistant.md │ └── blender.md │ └── bookdown │ ├── book.mdo │ ├── README.md │ ├── math.md │ ├── table.md │ ├── markdown.md │ ├── mdo.md │ └── CC-BY-SA_icon.svg ├── changelog.md ├── web ├── katex │ ├── fonts │ │ ├── KaTeX_AMS-Regular.eot │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_Main-Bold.eot │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-Italic.eot │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Math-Italic.eot │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.eot │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.eot │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_Math-Regular.eot │ │ ├── KaTeX_Math-Regular.ttf │ │ ├── KaTeX_Math-Regular.woff │ │ ├── KaTeX_Size1-Regular.eot │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size2-Regular.eot │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size3-Regular.eot │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size4-Regular.eot │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Caligraphic-Bold.eot │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.eot │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.eot │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-Regular.woff2 │ │ ├── KaTeX_SansSerif-Bold.eot │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.eot │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_Script-Regular.eot │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.eot │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_Typewriter-Regular.eot │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.eot │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.woff │ │ └── KaTeX_Typewriter-Regular.woff2 │ ├── contrib │ │ └── auto-render.min.js │ └── README.md ├── highlight │ └── default.min.css ├── js │ └── ui.js ├── purecss │ └── ui.js ├── main.css ├── bookdown.js └── css │ └── pure-min.css ├── test ├── mdTest.js ├── mtTest.js └── test.md ├── setting ├── setting.mdo ├── csr.pem ├── cert.pem └── key.pem ├── tool └── md2db.js ├── lib ├── mt.js ├── view.js ├── markdown.js ├── io.js ├── model.js └── mongo.js ├── .gitignore ├── locale ├── zh.json └── buildChineseDict.js ├── package.json ├── README.md ├── view └── view.html ├── server.js └── install /data/book/system/userAccount.md: -------------------------------------------------------------------------------- 1 |
西元 2050 年,爺爺的回憶錄
14 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney.md: -------------------------------------------------------------------------------- 1 | # 天國來的鈔票 -- 完整版 2 | 3 | | 標題 | 說明 | 4 | |--------|-----------| 5 | | [天國來的鈔票 (1)](HeavenMoney1.md) | 國王篇 | 6 | | [天國來的鈔票 (2)](HeavenMoney2.md) | 皇后篇 | 7 | | [天國來的鈔票 (3)](HeavenMoney3.md) | 大臣篇 | 8 | | [天國來的鈔票 (4)](HeavenMoney4.md) | 人民篇 | 9 | | [天國來的鈔票 (5)](HeavenMoney5.md) | 革命篇 | 10 | | [天國來的鈔票 (6)](HeavenMoney6.md) | 銀行家 | 11 | | [天國來的鈔票 (7)](HeavenMoney7.md) | 完結篇 | 12 | -------------------------------------------------------------------------------- /data/book/ccc/book.mdo: -------------------------------------------------------------------------------- 1 | title:C.C.Chen @ Bookdown=陳鍾誠 @ Bookdown 2 | editor:ccc 3 | locale:tw 4 | chapters: 5 | title | link 6 | ----------------------|-------------- 7 | C.C.Chen=陳鍾誠 | README.md 8 | Course=課程地圖 | course.md 9 | Book=書籍著作 | booklist.md 10 | Code=程式作品 | codelist.md 11 | Novel=小說故事 | novel.md 12 | Article=散文記事 | article.md 13 | Paper=論文研究 | paper.md 14 | Slide=十分鐘系列 | ../slide/ 15 | -------------------------------------------------------------------------------- /data/book/ccc/js1.md: -------------------------------------------------------------------------------- 1 | # JavaScript 程式設計 2 | 3 | 類型 | 書籍 | 作者 4 | -------|---------------------|---------- 5 | 教科書 | [專為中學生寫的 JavaScript 程式書](../jsh/) | 陳鍾誠 6 | 教科書 | [專為中學生寫的 JavaScript 程式書 - 網站設計篇](../jsw/) | 陳鍾誠 7 | 參考書 | [JavaScript 标准参考教程](http://javascript.ruanyifeng.com/) | 阮一峰 8 | 參考網站 |"+text.replace(/\n/gi, '')+"
"); 235 | } 236 | searchBox.innerHTML = searchHtml = lines.join("\n"); 237 | showBox(searchBox); 238 | }); 239 | } 240 | 241 | function logout() { 242 | ajaxPost("/logout", {}, function(r) { 243 | location.reload(); 244 | }); 245 | } 246 | 247 | // ====================== MT ==================================== 248 | var tw = { 249 | "menu":"選單", 250 | "edit":"編輯", 251 | "view":"檢視", 252 | "save":"存檔", 253 | "signup":"註冊", 254 | "login":"登入", 255 | "logout":"登出", 256 | "home":"首頁", 257 | "book":"書籍", 258 | "search":"搜尋", 259 | "user":"使用者", 260 | "locale":"語言", 261 | "NewBook":"寫書", 262 | "users":"使用者", 263 | "books":"書籍", 264 | "Contents":"內容", 265 | "GoBack":"回前頁", 266 | "User":"使用者", 267 | "Author":"作者", 268 | "Password":"密碼", 269 | "Profile":"私人", 270 | "System":"系統", 271 | "Global":"全球", 272 | "Error: Signup=false in Setting.mdo !":"錯誤:設定檔的 signup=false !", 273 | "Please login to save!":"請先登入後才能存檔!", 274 | "Save fail: You are not editor of the book !":"存檔失敗:你不是本書的編輯!", 275 | "Save Success!":"存檔成功", 276 | "Save Fail!":"存檔失敗", 277 | "Signup success!":"註冊成功", 278 | "Signup Fail: User name already taken by some others!":"註冊失敗:該名稱已被佔用!", 279 | "Login Success!":"登入成功!", 280 | "Login Fail!":"登入失敗!", 281 | "Logout Success!":"登出成功!", 282 | "Please login at first !":"請先登入!", 283 | "Create Book Success!":"創建書籍成功!", 284 | "Fail: Book already exist!":"登入失敗!", 285 | } 286 | 287 | function addToDictionary(locale, dic) { 288 | var d = dictionary[locale] || {} 289 | for (var e in dic) { 290 | d[e.toLowerCase()] = dic[e]; 291 | } 292 | dictionary[locale] = d; 293 | } 294 | 295 | function pageToLocale(locale) { 296 | if (typeof locale !== 'undefined') 297 | localStorage.locale = locale; 298 | render(); 299 | } 300 | 301 | function menuToLocale() { 302 | var nodes = document.getElementsByClassName("mt"); 303 | for (var i = 0; i < nodes.length; i++) { 304 | var node = nodes[i]; 305 | var e = node.getAttribute('data-mt'); 306 | var eMt = mt(e); 307 | node.innerHTML = eMt; 308 | } 309 | } 310 | 311 | function mt(msg) { 312 | var d = (localeChinese())?dictionary["tw"]:{}; 313 | var toMsg = d[msg.toLowerCase()]; 314 | msg = (typeof toMsg === 'undefined')?msg:toMsg; 315 | if (msg.indexOf("=")>=0) { 316 | var tokens = msg.split("="); 317 | msg = (localeChinese())?tokens[1]:tokens[0]; 318 | } 319 | return (localeChinese())?chineseMt(msg):msg; 320 | } 321 | 322 | /* 323 | 324 | function mt(msg) { 325 | var d = (localeChinese())?dictionary["tw"]:undefined; 326 | if (typeof d !== 'undefined') { 327 | var toMsg = d[msg.toLowerCase()]; 328 | msg = (typeof toMsg === 'undefined')?msg:toMsg; 329 | } 330 | if (msg.indexOf("=")>=0) { 331 | var tokens = msg.split("="); 332 | msg = (localeChinese())?tokens[1]:tokens[0]; 333 | } 334 | return (localeChinese())?chineseMt(msg):msg; 335 | } 336 | 337 | */ -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby 2 | # This script installs to /usr/local only. To install elsewhere you can just 3 | # untar https://github.com/Homebrew/brew/tarball/master anywhere you like or 4 | # change the value of HOMEBREW_PREFIX. 5 | HOMEBREW_PREFIX = "/usr/local".freeze 6 | HOMEBREW_REPOSITORY = "/usr/local/Homebrew".freeze 7 | HOMEBREW_CACHE = "#{ENV["HOME"]}/Library/Caches/Homebrew".freeze 8 | HOMEBREW_OLD_CACHE = "/Library/Caches/Homebrew".freeze 9 | BREW_REPO = "https://github.com/Homebrew/brew".freeze 10 | CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze 11 | 12 | # no analytics during installation 13 | ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" 14 | ENV["HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT"] = "1" 15 | 16 | module Tty 17 | module_function 18 | 19 | def blue 20 | bold 34 21 | end 22 | 23 | def red 24 | bold 31 25 | end 26 | 27 | def reset 28 | escape 0 29 | end 30 | 31 | def bold(n = 39) 32 | escape "1;#{n}" 33 | end 34 | 35 | def underline 36 | escape "4;39" 37 | end 38 | 39 | def escape(n) 40 | "\033[#{n}m" if STDOUT.tty? 41 | end 42 | end 43 | 44 | class Array 45 | def shell_s 46 | cp = dup 47 | first = cp.shift 48 | cp.map { |arg| arg.gsub " ", "\\ " }.unshift(first).join(" ") 49 | end 50 | end 51 | 52 | def ohai(*args) 53 | puts "#{Tty.blue}==>#{Tty.bold} #{args.shell_s}#{Tty.reset}" 54 | end 55 | 56 | def warn(warning) 57 | puts "#{Tty.red}Warning#{Tty.reset}: #{warning.chomp}" 58 | end 59 | 60 | def system(*args) 61 | abort "Failed during: #{args.shell_s}" unless Kernel.system(*args) 62 | end 63 | 64 | def sudo(*args) 65 | args.unshift("-A") unless ENV["SUDO_ASKPASS"].nil? 66 | ohai "/usr/bin/sudo", *args 67 | system "/usr/bin/sudo", *args 68 | end 69 | 70 | def getc # NOTE only tested on OS X 71 | system "/bin/stty raw -echo" 72 | if STDIN.respond_to?(:getbyte) 73 | STDIN.getbyte 74 | else 75 | STDIN.getc 76 | end 77 | ensure 78 | system "/bin/stty -raw echo" 79 | end 80 | 81 | def wait_for_user 82 | puts 83 | puts "Press RETURN to continue or any other key to abort" 84 | c = getc 85 | # we test for \r and \n because some stuff does \r instead 86 | abort unless (c == 13) || (c == 10) 87 | end 88 | 89 | class Version 90 | include Comparable 91 | attr_reader :parts 92 | 93 | def initialize(str) 94 | @parts = str.split(".").map(&:to_i) 95 | end 96 | 97 | def <=>(other) 98 | parts <=> self.class.new(other).parts 99 | end 100 | end 101 | 102 | def force_curl? 103 | ARGV.include?("--force-curl") 104 | end 105 | 106 | def macos_version 107 | @macos_version ||= Version.new(`/usr/bin/sw_vers -productVersion`.chomp[/10\.\d+/]) 108 | end 109 | 110 | def should_install_command_line_tools? 111 | return false if force_curl? 112 | return false if macos_version < "10.9" 113 | developer_dir = `/usr/bin/xcode-select -print-path 2>/dev/null`.chomp 114 | developer_dir.empty? || !File.exist?("#{developer_dir}/usr/bin/git") 115 | end 116 | 117 | def git 118 | return false if force_curl? 119 | 120 | @git ||= if ENV["GIT"] && File.executable?(ENV["GIT"]) 121 | ENV["GIT"] 122 | elsif Kernel.system "/usr/bin/which -s git" 123 | "git" 124 | else 125 | exe = `xcrun -find git 2>/dev/null`.chomp 126 | exe if $? && $?.success? && !exe.empty? && File.executable?(exe) 127 | end 128 | 129 | return unless @git 130 | # Github only supports HTTPS fetches on 1.7.10 or later: 131 | # https://help.github.com/articles/https-cloning-errors 132 | `#{@git} --version` =~ /git version (\d\.\d+\.\d+)/ 133 | return if $1.nil? 134 | return if Version.new($1) < "1.7.10" 135 | 136 | @git 137 | end 138 | 139 | def user_only_chmod?(d) 140 | return false unless File.directory?(d) 141 | mode = File.stat(d).mode & 0777 142 | # u = (mode >> 6) & 07 143 | # g = (mode >> 3) & 07 144 | # o = (mode >> 0) & 07 145 | mode != 0755 146 | end 147 | 148 | def chmod?(d) 149 | File.exist?(d) && !(File.readable?(d) && File.writable?(d) && File.executable?(d)) 150 | end 151 | 152 | def chown?(d) 153 | !File.owned?(d) 154 | end 155 | 156 | def chgrp?(d) 157 | !File.grpowned?(d) 158 | end 159 | 160 | # Invalidate sudo timestamp before exiting (if it wasn't active before). 161 | Kernel.system "/usr/bin/sudo -n -v 2>/dev/null" 162 | at_exit { Kernel.system "/usr/bin/sudo", "-k" } unless $?.success? 163 | 164 | # The block form of Dir.chdir fails later if Dir.CWD doesn't exist which I 165 | # guess is fair enough. Also sudo prints a warning message for no good reason 166 | Dir.chdir "/usr" 167 | 168 | ####################################################################### script 169 | abort "See Linuxbrew: http://linuxbrew.sh/" if RUBY_PLATFORM.to_s.downcase.include?("linux") 170 | abort "MacOS too old, see: https://github.com/mistydemeo/tigerbrew" if macos_version < "10.6" 171 | abort "Don't run this as root!" if Process.uid.zero? 172 | abort <<-EOABORT unless `dsmemberutil checkmembership -U "#{ENV["USER"]}" -G admin`.include? "user is a member" 173 | This script requires the user #{ENV["USER"]} to be an Administrator. 174 | EOABORT 175 | # Tests will fail if the prefix exists, but we don't have execution 176 | # permissions. Abort in this case. 177 | abort <<-EOABORT if File.directory?(HOMEBREW_PREFIX) && (!File.executable? HOMEBREW_PREFIX) 178 | The Homebrew prefix, #{HOMEBREW_PREFIX}, exists but is not searchable. If this is 179 | not intentional, please restore the default permissions and try running the 180 | installer again: 181 | sudo chmod 775 #{HOMEBREW_PREFIX} 182 | EOABORT 183 | 184 | ohai "This script will install:" 185 | puts "#{HOMEBREW_PREFIX}/bin/brew" 186 | puts "#{HOMEBREW_PREFIX}/share/doc/homebrew" 187 | puts "#{HOMEBREW_PREFIX}/share/man/man1/brew.1" 188 | puts "#{HOMEBREW_PREFIX}/share/zsh/site-functions/_brew" 189 | puts "#{HOMEBREW_PREFIX}/etc/bash_completion.d/brew" 190 | puts HOMEBREW_REPOSITORY.to_s 191 | 192 | group_chmods = %w[ bin bin/brew etc Frameworks include lib sbin share var 193 | etc/bash_completion.d lib/pkgconfig var/log 194 | share/aclocal share/doc share/info share/locale share/man 195 | share/man/man1 share/man/man2 share/man/man3 share/man/man4 196 | share/man/man5 share/man/man6 share/man/man7 share/man/man8]. 197 | map { |d| File.join(HOMEBREW_PREFIX, d) }. 198 | select { |d| chmod?(d) } 199 | # zsh refuses to read from these directories if group writable 200 | zsh_dirs = %w[share/zsh share/zsh/site-functions]. 201 | map { |d| File.join(HOMEBREW_PREFIX, d) } 202 | user_chmods = zsh_dirs.select { |d| user_only_chmod?(d) } 203 | chmods = group_chmods + user_chmods 204 | chowns = chmods.select { |d| chown?(d) } 205 | chgrps = chmods.select { |d| chgrp?(d) } 206 | mkdirs = %w[Cellar Homebrew Frameworks bin etc include lib opt sbin share share/zsh share/zsh/site-functions var]. 207 | map { |d| File.join(HOMEBREW_PREFIX, d) }. 208 | reject { |d| File.directory?(d) } 209 | 210 | unless group_chmods.empty? 211 | ohai "The following existing directories will be made group writable:" 212 | puts(*group_chmods) 213 | end 214 | unless user_chmods.empty? 215 | ohai "The following existing directories will be made writable by user only:" 216 | puts(*user_chmods) 217 | end 218 | unless chowns.empty? 219 | ohai "The following existing directories will have their owner set to #{Tty.underline}#{ENV["USER"]}#{Tty.reset}:" 220 | puts(*chowns) 221 | end 222 | unless chgrps.empty? 223 | ohai "The following existing directories will have their group set to #{Tty.underline}admin#{Tty.reset}:" 224 | puts(*chgrps) 225 | end 226 | unless mkdirs.empty? 227 | ohai "The following new directories will be created:" 228 | puts(*mkdirs) 229 | end 230 | 231 | wait_for_user if STDIN.tty? && !ENV["TRAVIS"] 232 | 233 | if File.directory? HOMEBREW_PREFIX 234 | sudo "/bin/chmod", "u+rwx", *chmods unless chmods.empty? 235 | sudo "/bin/chmod", "g+rwx", *group_chmods unless group_chmods.empty? 236 | sudo "/bin/chmod", "755", *user_chmods unless user_chmods.empty? 237 | sudo "/usr/sbin/chown", ENV["USER"], *chowns unless chowns.empty? 238 | sudo "/usr/bin/chgrp", "admin", *chgrps unless chgrps.empty? 239 | else 240 | sudo "/bin/mkdir", "-p", HOMEBREW_PREFIX 241 | sudo "/usr/sbin/chown", "root:wheel", HOMEBREW_PREFIX 242 | end 243 | 244 | unless mkdirs.empty? 245 | sudo "/bin/mkdir", "-p", *mkdirs 246 | sudo "/bin/chmod", "g+rwx", *mkdirs 247 | sudo "/bin/chmod", "755", *zsh_dirs 248 | sudo "/usr/sbin/chown", ENV["USER"], *mkdirs 249 | sudo "/usr/bin/chgrp", "admin", *mkdirs 250 | end 251 | 252 | [HOMEBREW_CACHE, HOMEBREW_OLD_CACHE].each do |cache| 253 | sudo "/bin/mkdir", "-p", cache unless File.directory? cache 254 | sudo "/bin/chmod", "g+rwx", cache if chmod? cache 255 | sudo "/usr/sbin/chown", ENV["USER"], cache if chown? cache 256 | sudo "/usr/bin/chgrp", "admin", cache if chgrp? cache 257 | end 258 | 259 | if should_install_command_line_tools? 260 | ohai "Searching online for the Command Line Tools" 261 | # This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools 262 | clt_placeholder = "/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress" 263 | sudo "/usr/bin/touch", clt_placeholder 264 | clt_label = `softwareupdate -l | grep -B 1 -E "Command Line (Developer|Tools)" | awk -F"*" '/^ +\\*/ {print $2}' | sed 's/^ *//' | tail -n1`.chomp 265 | ohai "Installing #{clt_label}" 266 | sudo "/usr/sbin/softwareupdate", "-i", clt_label 267 | sudo "/bin/rm", "-f", clt_placeholder 268 | sudo "/usr/bin/xcode-select", "--switch", "/Library/Developer/CommandLineTools" 269 | end 270 | 271 | # Headless install may have failed, so fallback to original 'xcode-select' method 272 | if should_install_command_line_tools? && STDIN.tty? 273 | ohai "Installing the Command Line Tools (expect a GUI popup):" 274 | sudo "/usr/bin/xcode-select", "--install" 275 | puts "Press any key when the installation has completed." 276 | getc 277 | sudo "/usr/bin/xcode-select", "--switch", "/Library/Developer/CommandLineTools" 278 | end 279 | 280 | abort <<-EOABORT if `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$?.success? 281 | You have not agreed to the Xcode license. 282 | Before running the installer again please agree to the license by opening 283 | Xcode.app or running: 284 | sudo xcodebuild -license 285 | EOABORT 286 | 287 | ohai "Downloading and installing Homebrew..." 288 | Dir.chdir HOMEBREW_REPOSITORY do 289 | if git 290 | # we do it in four steps to avoid merge errors when reinstalling 291 | system git, "init", "-q" 292 | 293 | # "git remote add" will fail if the remote is defined in the global config 294 | system git, "config", "remote.origin.url", BREW_REPO 295 | system git, "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*" 296 | 297 | # ensure we don't munge line endings on checkout 298 | system git, "config", "core.autocrlf", "false" 299 | 300 | args = git, "fetch", "origin", "master:refs/remotes/origin/master", 301 | "--tags", "--force" 302 | args << "--depth=1" unless ARGV.include?("--full") || !ENV["HOMEBREW_DEVELOPER"].nil? 303 | system(*args) 304 | 305 | system git, "reset", "--hard", "origin/master" 306 | 307 | system "ln", "-sf", "#{HOMEBREW_REPOSITORY}/bin/brew", "#{HOMEBREW_PREFIX}/bin/brew" 308 | 309 | system "#{HOMEBREW_PREFIX}/bin/brew", "update", "--force" 310 | else 311 | # -m to stop tar erroring out if it can't modify the mtime for root owned directories 312 | # pipefail to cause the exit status from curl to propagate if it fails 313 | curl_flags = "fsSL" 314 | core_tap = "#{HOMEBREW_PREFIX}/Homebrew/Library/Taps/homebrew/homebrew-core" 315 | system "/bin/bash -o pipefail -c '/usr/bin/curl -#{curl_flags} #{BREW_REPO}/tarball/master | /usr/bin/tar xz -m --strip 1'" 316 | 317 | system "ln", "-sf", "#{HOMEBREW_REPOSITORY}/bin/brew", "#{HOMEBREW_PREFIX}/bin/brew" 318 | 319 | system "/bin/mkdir", "-p", core_tap 320 | Dir.chdir core_tap do 321 | system "/bin/bash -o pipefail -c '/usr/bin/curl -#{curl_flags} #{CORE_TAP_REPO}/tarball/master | /usr/bin/tar xz -m --strip 1'" 322 | end 323 | end 324 | end 325 | 326 | warn "#{HOMEBREW_PREFIX}/bin is not in your PATH." unless ENV["PATH"].split(":").include? "#{HOMEBREW_PREFIX}/bin" 327 | 328 | ohai "Installation successful!" 329 | puts 330 | 331 | # Use the shell's audible bell. 332 | print "\a" 333 | 334 | # Use an extra newline and bold to avoid this being missed. 335 | ohai "Homebrew has enabled anonymous aggregate user behaviour analytics." 336 | puts <<-EOS 337 | #{Tty.bold}Read the analytics documentation (and how to opt-out) here: 338 | #{Tty.underline}https://git.io/brew-analytics#{Tty.reset} 339 | 340 | EOS 341 | 342 | if git 343 | Dir.chdir HOMEBREW_REPOSITORY do 344 | system git, "config", "--local", "--replace-all", "homebrew.analyticsmessage", "true" 345 | end 346 | end 347 | 348 | ohai "Next steps:" 349 | 350 | if macos_version < "10.9" && macos_version > "10.6" 351 | `/usr/bin/cc --version 2> /dev/null` =~ /clang-(\d{2,})/ 352 | version = $1.to_i 353 | if version < 425 354 | puts "- Install the #{Tty.bold}Command Line Tools for Xcode:" 355 | puts " #{Tty.underline}https://developer.apple.com/downloads#{Tty.reset}" 356 | end 357 | elsif !File.exist? "/usr/bin/cc" 358 | puts "- Install #{Tty.bold}Xcode:" 359 | puts " #{Tty.underline}https://developer.apple.com/xcode#{Tty.reset}" 360 | end 361 | 362 | unless git 363 | puts "- Run `brew update --force` to complete installation by installing:" 364 | puts " #{HOMEBREW_PREFIX}/share/doc/homebrew" 365 | puts " #{HOMEBREW_PREFIX}/share/man/man1/brew.1" 366 | puts " #{HOMEBREW_PREFIX}/share/zsh/site-functions/_brew" 367 | puts " #{HOMEBREW_PREFIX}/etc/bash_completion.d/brew" 368 | puts " #{HOMEBREW_REPOSITORY}/.git" 369 | end 370 | 371 | puts "- Run `brew help` to get started" 372 | puts "- Further documentation: " 373 | puts " #{Tty.underline}https://git.io/brew-docs#{Tty.reset}" 374 | -------------------------------------------------------------------------------- /data/book/ccc/blender.md: -------------------------------------------------------------------------------- 1 | # 如何透過 Blender 學習 3D 動畫設計 2 | 3 | ## 前言 4 | 5 | 我寫這篇文章的目的,是為了讓初學者可以快速的進入 Blender 動畫領域。 6 | 7 | 我是個程式設計者,在 2008 年開始透過 Blender 2.47 版學習動畫設計,我學習得很慢,因為一路上並沒有人教我,或者與我一起學習。 8 | 9 | 一開始學習 Blender 的時候,我仍然希望找到好的書籍幫助我學習,但是後來我發現自己錯了。 10 | 11 | 因為,學習動畫最好的資源,並不是書籍,而是教學影片。如果您嘗試透過書籍來學習 Blender ,您應該會與我當初一樣,落入「學習緩慢、格格不入」的窘境。因此,本文只是一堆教學影片的導引,重點在教學影片,而非文章本身。 12 | 13 | ## 安裝 14 | 15 | Blender 很小,很容易安裝,您可以從下列網址找到您想安裝的版本。 16 | 17 | *