版本:Ubuntu 14.04 LTS 默认语言:English(United States)
Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。
| export MACOSX_DEPLOYMENT_TARGET=11.0 | |
| brew install pyenv bzip2 zlib xz [email protected] | |
| ## 3.6.8 | |
| CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.6.8 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1) | |
| ## 3.6.12 | |
| CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.6.12 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1) | |
| ## 3.7.9 |
| #!/bin/bash | |
| usage() { | |
| echo "Usage:" | |
| echo " adbx proxy set" | |
| echo " adbx proxy get" | |
| echo " adbx proxy remove" | |
| } | |
| <template lang='pug'> | |
| div.drop-zone(:class='{dragging: isDragging }' | |
| @dragover.prevent='dragover' | |
| @dragenter.prevent='dragover' | |
| @drop.prevent.stop='onDrop' | |
| @dragleave.prevent='dragleave') | |
| div(:class='{ hidden: uploadInProgress }' @click='openFileBrowser') | |
| slot | |
| i {{label}} | |
| input(type='file' :multiple='multiple' ref='input' style='display: none') |
| require 'webrick' | |
| require 'fileutils' | |
| BIND_ADDRESS = "127.0.0.1" | |
| PORT = 8080 | |
| BACKUP_DIR = 'bak' | |
| if ARGV.length != 0 | |
| root = ARGV.first.gsub('\\', '/') |
| # = Usage | |
| # Download to your jekyll site directory, and run it | |
| # `ruby jekyll_image_fetcher.rb` | |
| Dir['_posts/*.md'].each do |path| | |
| content = File.open(path).read | |
| basename = File.basename path, '.md' | |
| content.gsub!(/!\[\]\((.+)\)/) do |m| | |
| url = $1 |
| $.rails.allowAction = function(link) { | |
| if (!link.attr('data-confirm')) { | |
| return true; | |
| } | |
| $.rails.showConfirmDialog(link); | |
| return false; | |
| }; | |
| $.rails.confirmed = function(link) { | |
| link.removeAttr('data-confirm'); |
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.