Skip to content

Instantly share code, notes, and snippets.

@ollym
Created October 30, 2010 12:59
Show Gist options
  • Save ollym/655273 to your computer and use it in GitHub Desktop.
Save ollym/655273 to your computer and use it in GitHub Desktop.
// EXAMPLE OF IMAGE
var image = require('image');
image = image.createImage(blob);
// Methods
image.resize(width, height, preserveAspectRatio);
image.crop(from_x, from_y, to_x, to_y);
image.rotate(degrees);
image.flip(horrizontal_or_vertical);
// Properties
image.width
image.height
/**
* MAIL MODULE
*
* The mail module is used to send and received.
*/
//
// Sending messages
//
var mail = require('mail');
var message = mail.createMessage(body);
// OR var message = new mail.Message();
message.body = 'Some mail message body!';
message.from = 'Albert Johnson <Albert.Johnson@example.com>';
message.to = 'Albert Johnson <Albert.Johnson@example.com>';
message.cc = 'Albert Johnson <Albert.Johnson@example.com>';
message.bcc = 'Albert Johnson <Albert.Johnson@example.com>';
message.attachments.push(blob);
message.send(to);
//
// Receiving messages
//
var mail = require('mail');
mail.createReceiver('*@example.com', function(message) {
// Message is an instance of mail.Message
});
/**
* Task Queue
*
* A task queue is used for
*/
var ts = requite('taskqueue');
var queue = ts.createQueue('name', time_till_live, asd);
// OR
var queue = ts.defaultQueue;
queue.addTask(task);
queue.addTask(function() { }, param1, param2, param3, _);
queue.addTask('some/uri', {
param1: '',
param2: '',
param3: ''
});
/**
*
*
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment