Find a mirror geographically close to you and use it like this:
pip install -i https://[mirror-url]/simple packageFor instance, using a Beijing mirror:
pip install -i https://pypi.douban.com/simple package| <!-- | |
| Inspired on Dr.Nic ruby-tmbundle (https://github.com/drnic/ruby-tmbundle/blob/master/Snippets/Insert%20ERb's%20%3C%25%20__%20%25%3E%20or%20%3C%25%3D%20__%20%25%3E.tmSnippet) | |
| In your Sublime Text 2 User folder (Sublime Text 2/Packages/User), create this file and give a name "erb.sublime-snippet". | |
| Than open a Ruby on Rails view file like HAML or ERB, type "erb" command and tab key. | |
| This create ERB tag on your view file. | |
| --> | |
| <snippet> | |
| <content><![CDATA[<%= ${0} %>]]></content> | |
| <tabTrigger>erb</tabTrigger> |
config/application.rbapp/models/spree/calculators/[class_name].rbClass must have the following methods:
def self.description
"Custom FlexiRate"
end
| class AddDeviseColumnsToUser < ActiveRecord::Migration | |
| def self.up | |
| change_table :users do |t| | |
| t.string :authentication_token | |
| end | |
| end | |
| def self.down | |
| change_table :users do |t| | |
| t.remove :authentication_token | |
| end |
| 1xx Informational | |
| 100 Continue :continue | |
| 101 Switching Protocols :switching_protocols | |
| 102 Processing :processing | |
| 2xx Success | |
| 200 OK :ok |
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
| return | |
| else |
| _complete_ssh_hosts () | |
| { | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
| cut -f 1 -d ' ' | \ | |
| sed -e s/,.*//g | \ | |
| grep -v ^# | \ | |
| uniq | \ | |
| grep -v "\[" ; |
| # put in config/application.rb | |
| config.to_prepare do | |
| ::PagesController.module_eval do | |
| caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
| caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
| end | |
| ::Page.module_eval do | |
| after_save :clear_static_caching! | |
| after_destroy :clear_static_caching! |