I hereby claim:
- I am jfromaniello on github.
- I am jose (https://keybase.io/jose) on keybase.
- I have a public key whose fingerprint is E084 A19D 285D C71D D8C2 1E56 FD13 B550 5327 DB0E
To claim this, I am signing this object:
//very very bad: | |
app.use(express.cookieParser()) | |
app.use(express.session({ secret: 'keyboard cat', key: 'sid', cookie: { secure: true }, store: blabla})) | |
app.use(express.static(__dirname + '/public')); | |
//good: | |
app.use(express.static(__dirname + '/public')); | |
app.use(express.cookieParser()) |
app.get('/foo', function (req, res) { | |
var proxy = request.get('https://foo.bar/blah'); | |
//intercept the response: | |
proxy.pipefilter = function (response, dest) { | |
console.log('The statusCode was: ', response.statusCode); | |
}; | |
proxy.pipe(res); | |
}); |
function onlyStatic (middleware) { | |
return function (req, res, next) { | |
var match = /(\.css|\.eot|\.gif|\.html|\.js|\.png|\.svg|\.ttf|\.woff|\.jpg)($|\?.*$)/ig.exec(req.originalUrl); | |
if (!match) return next(); | |
middleware(req, res, next); | |
}; | |
} | |
//usage | |
this.use(onlyStatic(express.static(__dirname + "/public"))); |
I hereby claim:
To claim this, I am signing this object:
var WebSocketServer = require('ws').Server; | |
var wss = new WebSocketServer({port: 8080}); | |
var jwt = require('jsonwebtoken'); | |
/** | |
The way I like to work with 'ws' is to convert everything to an event if possible. | |
**/ | |
function toEvent (message) { | |
try { |
define(function (require) { | |
var $ = require('jquery'); | |
require('typeahead'); | |
//boo | |
}); |
var auth0 = new Auth0({ | |
clientID: 'KgSjMN3OCwmrjvtjJ8bfuZyAaoKOrgH3', | |
domain: 'todos.auth0.com', | |
callbackURL: 'http://localhost:8080/' | |
}); | |
$(function () { | |
var tmpl_text = $('#item-tmpl').html(); | |
var item_tmpl = ejs.compile(tmpl_text); |
Script para Hubot que genera placas rojas de cronica.
Usa la página placasrojas.tv para generar la placa.
La imagen se sube a imgur usando el módulo node-imgur antes de enviarla al chat, ya que HipChat y algunos clientes de IRC necesitan una url que termine en .png/jpg etc.
class tmpreaper { | |
package { "tmpreaper": | |
ensure => installed, | |
} | |
cron { "reaptmp on reboot": | |
command => "/usr/sbin/tmpreaper -af 1h /tmp", | |
user => root, | |
special => "reboot", | |
require => Package['tmpreaper'], |