This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails server -e production -p 4000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
只需要运行一下命令即可知道 | |
ps -ef |grep httpd | |
运行之后就显示了httpd进程的运行用户 | |
当然也可以通过查看apache的httpd.conf配置文件来查看apache运行用户和组. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongoid' | |
Mongoid.configure.connect_to('mongoid_test') | |
class Post | |
include Mongoid::Document | |
belongs_to :person | |
end | |
class Person |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongoid' | |
Mongoid.configure.connect_to('mongoid_test') | |
class EventCourse | |
include Mongoid::Document | |
embeds_one :event | |
end | |
class Event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name foo.bar.com; | |
listen 80 default_server; | |
location = / { | |
proxy_pass http://localhost:11343/index.html; | |
} | |
location ~* /(fonts|js|html|css|images|img|lib|video)/ { | |
root /srv/www/foo.bar.com/public_html/public/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample 1 | |
var a = 1; // new number | |
a = 5; // new number | |
a = a + 2; // new number | |
// sample 2 | |
var name = "Roger"; | |
name.toUpperCase(); // name is unchanged | |
name = name.toUpperCase(); // name = new string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = "Roger"; | |
var b = "Roger"; | |
if (a == b) // => true | |
if (a === b) // => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample 1 | |
function foo(bar) { | |
bar = 2; | |
} | |
var a = 1; | |
foo(a); | |
alert(a); // => 1 | |
// sample 2 | |
var a = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var point = { x: 1, y: 7 }; | |
point.x = 2; | |
point.y = 9; | |
function fn() { | |
return true; | |
}; | |
fn.x = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = { x: 1, y: 7 }; | |
var b = { x: 1, y: 7 }; | |
if (a == b) // => false | |
if (a === b) // => false | |
b = a; | |
if (a == b) // => true | |
if (a === b) // => true |