Skip to content

Instantly share code, notes, and snippets.

View ericelliott's full-sized avatar
💭
https://leanpub.com/composingsoftware

Eric Elliott ericelliott

💭
https://leanpub.com/composingsoftware
View GitHub Profile
@ericelliott
ericelliott / tap-finished-fail.txt
Created March 27, 2013 01:07
tap-finished fail
$ npm test
npm WARN package.json [email protected] No README.md file found!
> [email protected] test /Users/erhamilt/dev/ccfeatures
> ./scripts/test.sh
refreshing cache
Database selected, 8
testing at: localhost.adobecc.com:8887
Listening on port: 8887
@ericelliott
ericelliott / prototypal-store
Created July 4, 2013 15:05
Some Hoodie store dreamcode -- first crack at a more fluent style prototypal approach.
// Store
// ============
// This class defines the API that other Stores have to implement to assure a
// coherent API.
//
// It also implements some validations and functionality that is the same across
// store impnementations
//
@ericelliott
ericelliott / store-stamp.js
Created July 4, 2013 15:20
hoodie store stamp (see stampit)
// Store
// ============
// This class defines the API that other Stores have to implement to assure a
// coherent API.
//
// It also implements some validations and functionality that is the same across
// store impnementations
//
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<section>
<h1 id="qunit-header">QUnit Test Suite</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
@ericelliott
ericelliott / route-export.js
Created September 9, 2013 01:17
Exporting routes for Express...
module.exports = function (app) {
app.post('/login',
passport.authenticate('local', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
};
@ericelliott
ericelliott / error
Created September 12, 2013 00:27
Easy to crash express service.
Unexpected end of input
SyntaxError: Unexpected end of input
at Object.parse (native)
at IncomingMessage.module.exports (/Users/erhamilt/dev/ccweb-main/node_modules/connect/lib/middleware/json.js:76:27)
at IncomingMessage.EventEmitter.emit (events.js:93:17)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
at Socket.socket.ondata (http.js:1825:22)
at TCP.onread (net.js:404:27)
@ericelliott
ericelliott / feature-toggles.md
Last active August 5, 2018 08:59
Feature Toggles - First Draft

Feature Toggle

Continuous deployment is the process of testing, integrating, and deploying software in rapid cycles in order to deliver bug fixes and new features to customers as quickly as possible. It gained popular acceptance as a cornerstone of extreme programming and agile development. It is very popular among Software as a Service providers.

A feature toggle system allows you to integrate features into your codebase even before they're finished and ready to release. During development, the features are toggled off by default. In order to turn them on, you must enable them manually. Using this method, you can deploy unfinished or untested changes into your production system without interfering with the user experience.

Feature toggles can allow software integration cycles that run in weeks, days, or even hours, as opposed to months or years. They are an essential component in a broader continuous integration system.

Feature toggles are popular in the startup community, but have gained widespr

@ericelliott
ericelliott / config-dependency-dreamcode.js
Last active December 26, 2015 14:08
How do you specify configuration dependencies for your app? Say you have app configuration that depends on other bits of app configuration (for example, some config lives at an http endpoint, but you need to read the endpoint URL from some other config before you can hit it).
/**
* Add support for config dependencies. This allows you to specify
* configuration that other configuration depends upon.
*/
test('Dependencies v4.callback', function (t) {
qconf.clear();
var subject = {hello: 'world'},
sentence = function (subject, cb) {
cb(null, 'goobye, cruel ' + subject);
};
@ericelliott
ericelliott / wtf_node
Created February 12, 2014 01:01
wtf node?
$ node
> var _ = require('underscore-node');
undefined
> _
undefined
> var stampit = require('stampit');
undefined
> stampit
{ [Function: stampit]
compose: [Function: compose],
@ericelliott
ericelliott / log-samples
Last active August 29, 2015 14:08
Broken redirect.
Nginx:
```
173.245.55.164 - - [05/Nov/2014:18:46:21 -0500] "GET /js/index.js HTTP/1.1" 200 23893 "http://moonshotcon.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
```
Apache2