This file contains hidden or 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
app.dynamicHelpers({ | |
session : function(req, res){ | |
return req.session; | |
} | |
}); |
This file contains hidden or 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
-if(session.user) | |
div#logoutsection.pull-right | |
a#logout-btn.btn.btn-info.pull-right.top-bar-form-button(href='logout/') Logout | |
p#loginprompt.pull-right.login-prompt #{session.user.username} | |
small logged In | |
-else | |
ul.pull-right | |
li | |
a#signup-btn.btn.pull-right.top-bar-form-button(href='#signup-modal', data-toggle="modal") Sign Up | |
form.pull-right.form-horizontal.top-bar-form(method="post", id="loginForm") |
This file contains hidden or 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
/** | |
* Logout the current user and clear the session | |
*/ | |
app.get('/logout', function(req, res){ | |
logger.log('Serving request for url [GET] ' + req.route.path); | |
req.session.user = undefined; | |
res.redirect('/'); | |
}); |
This file contains hidden or 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
app.dynamicHelpers({ | |
session : function(req, res){ | |
return req.session; | |
}, | |
someInfo : function(req, res){ | |
//getting, setting, and manipulation | |
return someAwesomeInfo; | |
}, | |
This file contains hidden or 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
if(username && password){ | |
$.post('/login', $(this).serialize(), function(response){ | |
if(response.retStatus === 'success'){ | |
$('#loginForm').hide(); | |
$('#signup-btn').hide(); | |
$(location).attr('href', '/'); | |
}else if(response.retStatus === 'failure'){ | |
$('#signup-error-modal').modal('show'); | |
} | |
}); |
This file contains hidden or 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
//javascript for the main page// | |
var initView = function(){ | |
//initialize a model | |
var Friend = Backbone.Model.extend({ | |
name : null, | |
initialize : function(){ | |
this.name = null; | |
} | |
}); |
This file contains hidden or 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
$dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 | |
$chmod 600 /root/myswapfile | |
mkswap /root/myswapfile | |
swapon /root/myswapfile |
This file contains hidden or 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
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- | |
r b swpd free buff cache si so bi bo in cs us sy id wa | |
0 0 726436 9584 9372 72132 0 0 0 66 94 259 6 5 89 0 | |
2 0 915176 13468 8312 77440 100 5818 11028 5976 1605 1494 28 61 11 1 | |
4 1 855756 40216 2940 52516 344 64056 32980 74284 2949 3885 24 72 5 1 | |
1 0 908288 10860 2412 82680 2684 29272 26826 39244 1858 4379 23 57 21 0 | |
4 2 908000 10196 2416 83600 194 0 632 0 181 472 10 10 80 0 | |
0 0 907756 10124 2560 83680 238 0 312 2 149 403 5 7 88 0 |
This file contains hidden or 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
$ free -k | |
total used free shared buffers cached | |
Mem: 502936 479724 23212 0 7872 89016 | |
-/+ buffers/cache: 382836 120100 | |
Swap: 1048572 940600 107972 |