Skip to content

Instantly share code, notes, and snippets.

@luiselizondo
luiselizondo / gist:5515058
Last active December 16, 2015 23:39
Software to download
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
// 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
@luiselizondo
luiselizondo / async.js
Created August 22, 2012 17:00
nodejs-async-blocks-example-async
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}
@luiselizondo
luiselizondo / nagios-client-script.sh
Created May 18, 2012 08:35
Configure Nagios Client
#!/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 }')
@luiselizondo
luiselizondo / Model.js
Created February 11, 2012 00:02 — forked from Pradeek/Model.js
NodeJS + MongoDB via Mongoose
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
@luiselizondo
luiselizondo / app.js
Created February 10, 2012 23:59 — forked from aaronksaunders/app.js
Develop a RESTful API Using Node.js With Express and Mongoose
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');