Skip to content

Instantly share code, notes, and snippets.

@ekmartin
ekmartin / weechat-notifier.plist
Last active August 29, 2015 14:01
A launchd-plist for weechat-notifier.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<key>weechat-notifier</key>
<key>EnvironmentVariables</key>
<dict>
<key>SERVER</key>
<string>(PLACEHOLDER) Server IP goes here.</string>
var article = new Article(parsedFields);
article.union = req.params.union;
article.image = files.file[0];
console.log('for', article.image, article.image.path, 'fil', files.file[0], files.file[0].path);
/* output:
for [object Object] undefined fil { fieldName: 'file',
originalFilename: '536a69d70368983f0c4bff23.png',
path: '/var/folders/_1/07xdf3092n79l_yjgsd7bmkc0000gn/T/16266-pr6udj.png',
headers:
var path = require('path');
var saveImage = function(article, image, fn) {
var ending = path.extname(image.originalFilename);
var unionPath = __dirname + '/../../public/images/unions/' + article.union;
var newPath = unionPath + '/' + article._id + ending;
var newPathCropped = unionPath + '/' + article._id + '_cropped' + ending;
mkdirp(unionPath, function(err) {
if (err) return fn(err);