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 application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
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 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 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 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 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 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 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
<?php | |
/** | |
* Class HTML_To_Markdown | |
* | |
* A helper class to convert HTML to Markdown. | |
* | |
* @version 2.1.1 | |
* @author Nick Cernis <[email protected]> | |
* @link https://github.com/nickcernis/html2markdown/ Latest version on GitHub. | |
* @link http://twitter.com/nickcernis Nick on twitter. |
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
#!/bin/bash | |
############################################################################ | |
# Note: Special network 192.162.50.3 to use Cisco Anyconnect Split tunnel. | |
# | |
# On OX X host you need to add a line (and file) /etc/exports: | |
# /Users -mapall=[youruser]:[yourgroup] [boot2dockerip] | |
# See: https://quip.com/EDYLAAfuup5M (no login needed) | |
# See also: https://github.com/boot2docker/boot2docker/issues/587#issuecomment-66935011 | |
# See also: http://support.apple.com/en-us/HT202243 |
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 sinon = require('sinon'), | |
wolfpack = require('wolfpack'); | |
// Mock EmailSender | |
global.EmailSender { | |
sendEmailToUser: sinon.stub() | |
}; | |
// Instantiate you model | |
global.User = wolfpack('path_to_models/User'); |
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
'use strict'; | |
var assert = require("assert"); | |
var should = require("should"); | |
var include = require("include"); | |
var bootstrap = include("test/bootstrap.test"); | |
var Factory = require("sails-factory").load(); | |
var Chance = require("chance"); |
OlderNewer