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
| VM Software | |
| VirtualBox (Just if you want to create a VM) | |
| -- https://www.virtualbox.org/ | |
| OS | |
| Ubuntu or Fedora | |
| -- http://www.ubuntu.com | |
| -- http://fedoraproject.org/ | |
| IDE |
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
| // Simple debug output helper | |
| function debug(message) { | |
| Ti.API.info(message); | |
| } | |
| /** | |
| * | |
| * @param thisControl The control you wish to dump | |
| * @param goDeep boolean Do you want deep introspection | |
| * @param incFuncs boolean Do you want to include functions in the output when going deep |
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
| async.series({ | |
| somedata: function(callback){ | |
| // query the database to get "somedata" and pass the result to callback | |
| }, | |
| someextradata: function(callback){ | |
| // query the database to get the "someextradata" and pass the result to callback | |
| }, | |
| }, | |
| function(err, results) { | |
| // results is now equal to: {somedata: yourData, someextradata: yourExtraData} |
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
| #!/bin/bash | |
| function ask { | |
| echo -n "Allowed IP to access NRPE: " | |
| # read -e ALLOWEDIP | |
| } | |
| function system_primary_ip { | |
| # returns the primary IP assigned to eth0 | |
| echo $(ifconfig eth0 | awk -F: '/inet addr:/ {print $2}' | awk '{ print $1 }') |
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
| var mongoose = require('mongoose'); | |
| mongoose.connect('YOUR_MONGODB_PATH'); | |
| var Schema = mongoose.Schema; | |
| var ArticleSchema = new Schema({ | |
| id : String, | |
| title : String, | |
| body : String, | |
| date : Date |
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
| var application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |
NewerOlder