Skip to content

Instantly share code, notes, and snippets.

defmodule ExList do
def span(from, to) when from < to do
_span([], from, to)
end
defp _span(list, from, to) when from > to do
list
end
// var threadsToLoad = [],
// _thread;
// restrict number of threads to load
var threadsToLoad = (function _getThreads(loadThreads, allThreads) {
var thread = allThreads.shift();
if (thread && loadThreads.length < settings.maxSourceListItemsToCache) {
loadThreads.push(thread);
return _getThreads(loadThreads, allThreads);
} else return loadThreads;
function apocalypse(exitOnError) {
process.on('uncaughtException', function(err) {
process.removeListener('uncaughtException', arguments.callee);
logger.fatal(err);
if (exitOnError) {
var s = logger.streams[0];
define(['common', 'async'], function(common, async) {
'use strict';
function Emitter() {
this.events = {};
}
(function p(msg, meta, formatArgs, args) {
var arg = args.shift();
if (arg) {
if (typeof(arg) !== 'object')
formatArgs.push(arg);
else
meta = arg;
p(msg, meta, formatArgs, args);
} else
self._logger[level].apply(self._logger, [].concat.apply([], [meta, msg, formatArgs]));
#!/bin/sh
# Setup some variables needed for bootstrapping the environment
ROOT=/home/vrde/projectz/myproject
REPOS=${ROOT}/repos
export PYTHONPATH=${REPOS}
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
ConnectionHandler.prototype.getConnectionForFolder = function(folder, action) {
var conn = this.searchConnection(),
deferred = Q.defer();
conn.waitUntilUnlocked()
.then(function() {
return conn.lock();
})
.then(function() {

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

var Q = require('q'),
_ = require('lodash');
var eventualAdd = function(n1, n2) {
return Q.promise(function(resolve, reject, notify) {
var n = setInterval(function() {
notify("working");
}, 100);