Skip to content

Instantly share code, notes, and snippets.

View outsideris's full-sized avatar

Outsider outsideris

View GitHub Profile
@outsideris
outsideris / function.js
Created August 5, 2015 09:55 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@outsideris
outsideris / server.js
Last active January 9, 2017 02:21 — forked from nanha/node.js express logger
node.js express middleware 중에서 logger를 사용하여 실제 파일로 logging 하는 방법
/**
* express 처음에 init 하시면 app.js 를 비롯하여 여러 디렉토리가 생기는데
* logs 디렉토리에 아무것도 안남는다고 의문을 가지신 분에게 도움이 될거 같습니다.
* connect의 middleware logger 는 기본이 stdout 으로 출력하고 있었네요.
* http://senchalabs.github.com/connect/middleware-logger.html
* manual을 살펴보니 stream options 이 있었군요.
* 한번 생각나서 fs core module의 createWriteStream 을 사용하여 해봤더니 잘되네요.
* 다른 방법도 있으신분은 알려주세요
*/
var fs = require('fs'),