Enhance existing template languages with filters to allow email marketers to focus on design and content, not esoteric email client development.
Below takes a stab using the Jade templating language.
:email(width = 640)
:preheader
// doesn't work yet :) | |
var selectors = [ | |
'.name', | |
'.created', | |
'td p:first-child', | |
'.updated', | |
'.unsent', | |
'.sent', | |
'.opened', | |
'.clicked', |
insert into emails where guid = '123abc' (duplicate_ids) values (['456feg', '789wer']); |
var Readable = require('stream').Readable | |
, util = require('util') | |
; | |
util.inherits(FakeReadable, Readable); | |
function FakeReadable(options) { | |
var self = this; | |
Readable.call(self); | |
self.push(new Buffer('data')); | |
setTimeout(function() { |
function fn(array) { | |
return array | |
.sort(function(a,b) { return a - b }) | |
.reduce(function(sum, val, idx, sorted) { | |
// this still has holes in it, not testing correct things: | |
return (idx == sorted.length - 1) ? sum > sorted[idx] : sum + val; | |
}, 0); | |
} | |
console.log('[4, 6, 23, 10, 1, 3]', fn([4, 6, 23, 10, 1, 3])); //=> true |
:section(width = 640) | |
a(href = '#') | |
p Lorem ipsum dolor |
(function() { | |
var loop = true, | |
tcp = new Socket, | |
psd = app.activeDocument; // i.e., `psd` is the current open document in Photoshop. | |
var run = function() { | |
// Server is running a port 1234: | |
while(loop) { | |
var connection = tcp.poll(); | |
if (connection != null) { |
var request = require('request') | |
, uri = 'http://domain.com/long_file.mp3'; | |
// assumes `res` is a response object | |
request(uri).pipe(res); |
require 'open-uri' | |
uri = 'http://domain.com/long_file.mp3' | |
# assumes `send_data` sends response: | |
send_data(open(uri).read, type: 'audio/mpeg') |