Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#define SIZE 10
int q , r , i = 0;
int RA[SIZE] = {1,2,3,4,5,6,7,8,9,10};
int STACK_Q [SIZE] = {0};
int STACK_R [SIZE] = {0};
int main()
Updating app testy
info: Activating snapshot 0.0.1-2 for testy
info: Starting app testy
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: socket hang up
error: at createHangUpError (http.js:1263:15)
error: at Socket.socketOnEnd (http.js:1351:23)
error: at TCP.onread (net.js:417:26)
@amichaelgrant
amichaelgrant / gist:3610913
Created September 3, 2012 17:08
jitsu databases list
/usr/lib/node_modules/jitsu/lib/jitsu/commands/databases.js:181
results.forEach(function (database) {
^
TypeError: Object #<Object> has no method 'forEach'
at databases.list (/usr/lib/node_modules/jitsu/lib/jitsu/commands/databases.js:181:15)
at Databases.list (/usr/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/databases.js:56:5)
at Request.Client.request [as _callback] (/usr/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/client.js:109:5)
at Request.request.self.callback (/usr/lib/node_modules/jitsu/node_modules/nodejitsu-api/node_modules/request/main.js:104:22)
at Request.<anonymous> (/usr/lib/node_modules/jitsu/node_modules/nodejitsu-api/node_modules/request/main.js:458:18)
at Request.EventEmitter.emit (events.js:88:17)
@amichaelgrant
amichaelgrant / gist:3633769
Created September 5, 2012 09:07
jitsu databases list : failing
grant >> jitsu databases list
info: Welcome to Nodejitsu imike
info: It worked if it ends with Nodejitsu ok
info: Executing command databases list
/usr/lib/node_modules/jitsu/lib/jitsu/commands/databases.js:181
results.forEach(function (database) {
^
TypeError: Object #<Object> has no method 'forEach'
at databases.list (/usr/lib/node_modules/jitsu/lib/jitsu/commands/databases.js:181:15)
http://seanstechnologyblog.blogspot.com/2010/09/kannel-configuration-file.html
@amichaelgrant
amichaelgrant / server.js
Created September 22, 2012 13:57 — forked from atian25/server.js
socket.io + express session
//express3.0
var express = require('express');
var app = express();
app.set('port', 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
//session & cookie
@amichaelgrant
amichaelgrant / echo.cxx
Created October 3, 2012 19:23 — forked from koblas/echo.cxx
libev c++ echo server
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <ev++.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <resolv.h>
#include <errno.h>
#include <list>
@amichaelgrant
amichaelgrant / app.js
Created October 10, 2012 14:16 — forked from mrnugget/app.js
node.js, express.js and socket.io — basic server/client communication via interface
var io = require('socket.io');
var express = require('express');
var app = express.createServer();
var server = app.listen(8080);
var ioServer = io.listen(server);
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
@amichaelgrant
amichaelgrant / storeImgInMongoWithMongoose.js
Created October 16, 2012 18:04 — forked from aheckmann/storeImgInMongoWithMongoose.js
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@amichaelgrant
amichaelgrant / gist:3926833
Created October 21, 2012 12:17 — forked from drinchev/gist:2266544
Integrate NowJS with Express and Passport
var express = require('express')
, passport = require('passport')
, sessionStore = new express.session.MemoryStore()
, app = module.exports = express.createServer()
, nowjs = require('now');
app.configure( function () {
app.use(express.bodyParser());