Skip to content

Instantly share code, notes, and snippets.

View devmoreno's full-sized avatar

Edwin Moreno devmoreno

View GitHub Profile
var gente ={};
gente.people="nombre";
gente.name="Edwin"
alert(gente);
@devmoreno
devmoreno / gist:1715624477d67bcb9e6f
Created July 29, 2014 19:03
Node.Js Install Mac
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
exports.model = function(){
//Declare our dictionary to return to the table view
var model;
//Connection Example
/*
* First we create our url and our response variable and then create our client function
*/
var url = "http://takeoutapi.azurewebsites.net/api/menu/", response;
//First http connection
(function(){
var deferred = Q.defer();
var url = "http://takeoutapi.azurewebsites.net/api/menu/", response;
var checkConn = Ti.Network.createHTTPClient({
//On Sucess
onload : function()
{
//Q
Ti.API.info("onload: "+this.responseText);
@devmoreno
devmoreno / server.js
Created February 11, 2015 13:23
finally understand gist
// Call the requirements
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var morgan = require('morgan');
var mongoose = require('mongoose');
var port = process.env.PORT || 8080;
//var User = require('./model/Users');
Q = require("q");
@devmoreno
devmoreno / server.js
Created February 11, 2015 13:38
grheg
example()
.then(example2)
.then(example3)
.done(function(promise){
console.log(promise.new);
console.log("Finished");
});
@devmoreno
devmoreno / server.js
Created February 11, 2015 13:42
srgre
example()
//Second Call
.then(example2 /*, **Function for on reject** */)
//Third Call
.then(example3 /*, **Function for on reject** */)
//Last Call
.done(function(promise){
console.log(promise.new);
console.log("Finished");
});
app.get("/", function(req, res){
fetchModel()
//Second Call
.then(scanDifferences /*, **Function for on reject** */)
//Third Call
.then(insertNewones /*, **Function for on reject** */)
//Last Call
.done(function(promise){
res.json({"Name": "Hello"})
});
@devmoreno
devmoreno / 0_reuse_code.js
Created December 29, 2015 21:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@devmoreno
devmoreno / CheatCheat.js
Last active April 14, 2022 18:36
Collection of Node.js Refresheners from various sources
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html