mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to/usr/local/etc/nginx/
default
anddefault-ssl
to/usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to/Library/LaunchDaemons/
http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs | |
http://cdnjs.com | |
http://www.jsdelivr.com | |
http://jscdn.upai.com | |
http://cachedcommons.org/ | |
http://www.bootstrapcdn.com | |
http://www.maxcdn.com/ | |
http://www.asp.net/ajaxlibrary/cdn.ashx | |
https://developers.google.com/speed/libraries/devguide#angularjs |
{ | |
"always_show_minimap_viewport": true, | |
"binary_file_patterns": | |
[ | |
"*.jpg", | |
"*.jpeg", | |
"*.png", | |
"*.gif", | |
"*.ttf", | |
"*.woff", |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to /usr/local/etc/nginx/
default
and default-ssl
to /usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to /Library/LaunchDaemons/
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render
in a controller when we want to respond within the current request, and redirect_to
when we want to spawn a new request.
The render
method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form'
or render @post.comments
, but here we'll focus on usage within the controller.
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
# Speed things up by not loading Rails env | |
config.assets.initialize_on_precompile = false |
directory = '~/Development/Work/gart360-web' | |
url = 'http://gart.dev:3000' | |
before { run "cd #{directory}" } | |
run 'fs' | |
tab do | |
run "tlog" | |
end |
1. install bakcup and whenever gem | |
``` | |
gem 'backup' | |
gem 'whenever' | |
``` | |
2. capistrano task(for uploading config file, put it to lib/capistrano/tasks/backup.rake) | |
``` | |
namespace :backup do |
there are two ways to passing args to rake task
please refer to https://itshouldbeuseful.wordpress.com/2011/11/07/passing-parameters-to-a-rake-task/
$ rake say_hello[eddie], or rake say_hello name='eddie'
desc 'say hello'
task :say_hello1 do
name = ENV['name']
puts "Hello, #{name}."
end