This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
node_modules | |
*.swp |
var xhr = function() { | |
var xhr = new XMLHttpRequest(); | |
return function( method, url, callback ) { | |
xhr.onreadystatechange = function() { | |
if ( xhr.readyState === 4 ) { | |
callback( xhr.responseText ); | |
} | |
}; | |
xhr.open( method, url ); | |
xhr.send(); |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var doctors = [ | |
{ number: 1, actor: "William Hartnell", begin: 1963, end: 1966 }, | |
{ number: 2, actor: "Patrick Troughton", begin: 1966, end: 1969 }, | |
{ number: 3, actor: "Jon Pertwee", begin: 1970, end: 1974 }, | |
{ number: 4, actor: "Tom Baker", begin: 1974, end: 1981 }, | |
{ number: 5, actor: "Peter Davison", begin: 1982, end: 1984 }, | |
{ number: 6, actor: "Colin Baker", begin: 1984, end: 1986 }, | |
{ number: 7, actor: "Sylvester McCoy", begin: 1987, end: 1989 }, | |
{ number: 8, actor: "Paul McGann", begin: 1996, end: 1996 }, | |
{ number: 9, actor: "Christopher Eccleston", begin: 2005, end: 2005 }, |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |