/etc/init.d/apache2 start/stop/restart
/etc/apache2/ // main folder
define(function() { | |
var ScriptLoader = function(url, ns, onLoadCallback, name) { | |
this.url = url; // url of the module | |
this.ns = ns; // source obj/ns obj to bind 'define' method | |
this.onLoadCallback = onLoadCallback; | |
this.name = name; // dependency name | |
this.load(); | |
}; |
/* | |
* Mongoose magic | |
*/ | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost:27017/fei'); | |
var db = mongoose.connection; | |
db.on('error', console.error.bind(console, 'connection error')); | |
db.once('open', function() { | |
var kittySchema = mongoose.Schema({ | |
name: String |
In computer programming, an iterator is an object that enables a programmer to traverse a container.
When invoked, generator functions return iterators
Run-to-completion scheduling is a scheduling model in which each task runs until it either finishes, or explicitly yields control back to the scheduler.
var constructor = function() {return null;}; | |
var f = function f() { | |
return constructor(); | |
}; | |
f(); | |
// Under ES3 | |
// logs {}, object literal | |
// Under ES5 |
this
will not refer to window
objectcallee
, caller
of arguments
object are not allowed under strict modeparameter
is not refereced linked to arguments
object, no strict mode, parameter
is a reference of the arguments
object.(function() {
var nostrict = function(x) {
arguments[0] = 'modified';
console.log('arguments[0] =', arguments[0]);
console.log('x=', arguments[0]);
console.log('under non-strict mode,', x === arguments[0]); // log true
Parsing a document means translating it to a structure the code can use. The result of parsing is usually a tree of nodes that represent the structure of the document. This is called a parse tree or a syntax tree.
Parsing is based on the syntax rules the document obeys: the language or format it was written in. Every format you can parse must have deterministic grammar consisting of vocabulary and syntax rules.
Parsing can be separated into two sub processes: lexical analysis and syntax analysis.
Lexical analysis is the process of breaking the input into tokens
Tokens are the language vacabulary: the collection of valid building blocks.
bare clone | |
create a folder with name new_bare_clone.git | |
cd new_bare_clone.git | |
git init --bare | |
To push to this branch | |
git remote add origin "ssh://[email protected]/~/repos/to/folder" | |
From a local to push up |
#!/bin/bash | |
# | |
# NOTE: specify the desired level of logging. | |
# | |
# - none, debug, warn, error | |
# | |
chunkc core::log_level error |