Skip to content

Instantly share code, notes, and snippets.

View davidmarkclements's full-sized avatar

David Mark Clements davidmarkclements

View GitHub Profile
@davidmarkclements
davidmarkclements / gist:f33ca640cffb8a91129a
Created August 18, 2014 15:48
seneca.cmds with __proto__ - proof of concept
//usage:
cmds({
__proto__: {general: 'pattern'},
a: {specificying:'pattern'}
})
.$a(function (err, args) {
console.log(args, Object.keys(args))
})
//after 1.5 secs logs Object {specificying: "pattern", general: "pattern"} ["specificying"]
@davidmarkclements
davidmarkclements / gist:bd8e84df62e55dd9cf95
Last active August 29, 2015 14:05 — forked from davidmarkclements/gist:f33ca640cffb8a91129a
seneca.cmds with $ master - proof of concept
//usage:
cmds({
$: {general: 'pattern'},
a: {specificying:'pattern'}
})
.$a(function (err, args) {
console.log(args, Object.keys(args))
})
//after 1.5 secs logs Object {specificying: "pattern", general: "pattern"} ["specificying", "general"]
@davidmarkclements
davidmarkclements / gist:8d30f6e613496776a9f5
Created September 1, 2014 20:59
Verifying that +clements is my Bitcoin username. You can send me #bitcoin here: https://onename.io/clements
Verifying that +clements is my Bitcoin username. You can send me #bitcoin here: https://onename.io/clements

Seshver

Session Based Versioning

Seshver is version standard for the purpose of versioning content that is to delivered in units or slots - termed as "sessions".

It takes the same form as semver, but semantic meaning is different.

//fails:
var c = 0
seneca.add({role: 'user', cmd: 'create'}, function(args, callback) {
if (c++ < 1) callback(null)
else {
var err = {};
err.statusCode = 409;
callback(err);
}
})
```js
console.log('will not currently highlight in deck')
```
```javascript
console.log('will not highlight in deck')
```
@davidmarkclements
davidmarkclements / gist:0c4041d21fafefdc86fe
Created March 19, 2015 11:33
Example shrinkwrap.json file, created from npm-dependents module
{
"name": "npm-dependents",
"version": "1.0.1",
"dependencies": {
"JSONStream": {
"version": "0.10.0",
"from": "JSONStream@*",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.10.0.tgz",
"dependencies": {
"jsonparse": {
@davidmarkclements
davidmarkclements / fast.md
Created August 20, 2016 18:49 — forked from yoshuawuyts/fast.md
Idea - Single Request SPA
const bench = require('fastbench')
function valuesFn (array) {
var i = 0
return function (abort, cb) {
if(i >= array.length)
cb(true)
else
cb(null, array[i++])
}
{"vomicae": "sit et nisi aliqua Lorem eu dolore et consequat officia", "epicarp": "tempor qui consectetur laborum irure cupidatat sunt magna culpa aliquip", "hierarchised": "reprehenderit irure mollit proident est Lorem fugiat cillum id excepteur", "unripened": "proident laborum velit ipsum exercitation sint ut pariatur incididunt non", "enterrologist": "proident irure duis laboris consequat voluptate mollit commodo aliqua nisi", "barterer": "voluptate duis sit voluptate cupidatat duis sit nostrud do magna", "characterless": "ut qui quis et consectetur est quis duis reprehenderit aliqua", "keelless": "deserunt qui dolore id dolore minim commodo eiusmod non quis", "redissolution": "aliqua proident ullamco cupidatat aliqua fugiat ea consequat ea cillum", "scharwenka": "occaecat amet id cupidatat pariatur qui reprehenderit esse anim commodo", "flask": "ex incididunt nulla enim irure culpa ut culpa do deserunt", "methodically": "proident aute mollit pariatur eu ex veniam tempor qui incididunt", "equivalency": "al