This file contains hidden or 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
function fetchEmails = function (range, options, query, mailbox, done) { | |
var emails = []; | |
if(!mailbox) | |
return done({error: 'mailbox not ready'}); | |
query.cb = function (fetch) { | |
fetch.on('message', function (msg) { | |
var headers = {}, | |
body = ''; |
This file contains hidden or 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
exports.fetchConversationDetail2 = function (req, res) { | |
var contact = req.params.contact; | |
console.log(contact); | |
async.auto({ | |
search_from: function (done) { | |
imap.search([['HEADER', 'FROM', contact]], done); | |
}, | |
search_to: function (done) { |
This file contains hidden or 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 IMAP = require('imap'); | |
var imap = new IMAP({ | |
user: '[email protected]', | |
password: 'redcontact', | |
host: 'imap.gmail.com', | |
port: 993, | |
secure: true, | |
debug: console.log | |
}); |
This file contains hidden or 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
// a.js | |
var moduleB = require('./b'); | |
function ModuleA() { | |
} | |
ModuleA.hello = function () { | |
console.log('hello!'); | |
}; |
This file contains hidden or 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
function findAvailablePort(app, done) { | |
var port = portrange; | |
portrange += 1; | |
var server = http.createServer(app); | |
server.listen(port, function (err) { | |
done(server, port); | |
}); |
This file contains hidden or 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
frontApp.directive('fastScroll', ['$parse', function ($parse) { | |
var Interval = function(min, max) { | |
this.min = min || 0; | |
this.max = max || 0; | |
}; | |
Interval.prototype.clip = function(min, max) { | |
if(this.max <= min || this.min >= max) { | |
this.min = this.max = 0; |
This file contains hidden or 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
app.directive('faFastScroll', ['$parse', function ($parse) { | |
var Interval = function(min, max) { | |
this.min = min || 0; | |
this.max = max || 0; | |
}; | |
Interval.prototype.clip = function(min, max) { | |
if(this.max <= min || this.min >= max) { | |
this.min = this.max = 0; |
This file contains hidden or 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
defaults write com.yourcompany.YourApp WebKitDeveloperExtras -bool true |
This file contains hidden or 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
- (void)runJavaScript:(NSString *)command { | |
NSLog(@"js: %@", command); | |
[self.web stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"if (typeof jsapi !== 'undefined') %@;", command]]; | |
} | |
- (void)toggleArchived { | |
[self runJavaScript:@"jsapi.toggleArchiveConversation()"]; | |
} |
This file contains hidden or 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
$window.jsapi = { | |
refresh: function () { | |
emitRootScope('refresh'); | |
}, | |
search: function (query) { | |
$rootScope.$apply(function () { | |
locations.search(query); | |
}); | |
}, |
OlderNewer