Skip to content

Instantly share code, notes, and snippets.

View Enome's full-sized avatar

Geert Pasteels Enome

View GitHub Profile
@Enome
Enome / errors.js
Last active August 29, 2015 14:01
/** @jsx React.DOM */
var data = arrayWithEvents;
var ErrorComponent = React.createClass({
/* LOGIC */
_update: function () {
this.setState({ errors: data.errors() })
@Enome
Enome / nginx.conf
Created October 24, 2013 11:51 — forked from srpouyet/nginx.conf
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/sbin/nginx
app.use(function (req, res, next) {
if(req.url.substr(req.url.length - 4) === '.php') {
return res.redirect(301, req.url.substr(0, req.url.length - 4);
}
next();
});

enome-components/some-component

var mod = window.angular.module('some-module', []);
module.exports = 'some-module'; //Export the name as a string.

Main app

// General Middleware
app.use(..);
app.use(..);
// Router
app.get('/', function (req, res, next) {
res.send('hello');
next();
var service = function () {
var ee = new EventEmitter();
process.nextTick(function () {
ee.emit('error', 'some error');
ee.emit('service', 'some serice');
});
return {
@Enome
Enome / gist:5199203
Last active December 15, 2015 04:09 — forked from kenperkins/gist:5199162
var service = something('foo');
service.error(function (error) {
next(error)
});
service.client(function (client){
// do stuff with client
});
var http = require('http');
var https = require('https');
var ping = function (domain, callback) {
var protocol = http;
if (domain.url.indexOf('https') === 0) {
protocol = https;
}
app.get('/users/:username',
data.one('user', data_users.byUsername, 'params.username'),
data.many(data_grows.byUserId, 'locals.user.id'),
general.render('grows/index'));
1 class {'postgresql::server':
2 listen => ['*',],
3 acl => ['host all all 0.0.0.0/0 md5', 'local all all trust', ],
4 }
5
6 postgresql