1,135 karma · joined Mar 22, 2009 (17y ago) · 212 submissions
comment 10y ago · link · parent
comment 10y ago · link · parent
With CouchDB, you can sometimes get hold of old revisions of a document.
For example, if you fetch /db/bob?rev=v2b&revs_info=true you'll get a list
of the previous revision ids which ended up with revision v2b. Doing the
same for v2a you can find their common ancestor revision. However if the
database has been compacted, the content of that document revision will
have been lost. revs_info will still show that v1 was an ancestor, but
report it as "missing".
That is a very dangerous feature for us. Also, the conflict avoidance algorithm means that users can't work on branches in parallel like in git because couchdb obstructs that workflow with 409 responses. This is a very bad feature when you're collecting data in remote areas and replicating with other databases and don't have the time, battery life, or the expert skills to resolve a "conflict". A database should never have states where it rejects new information.comment 10y ago · link · parent
var wswarm = require('webrtc-swarm')
var signalhub = require('signalhub')
var swarm = wswarm(signalhub('p2p-map', ['https://signalhub.mafintosh.com'])
var osm = require('osm-p2p')()
swarm.on('peer', function (peer, id) {
peer.pipe(osm.log.replicate()).pipe(peer)
})comment 10y ago · link · parent
comment 10y ago · link · parent
> Imagine being able to download just one build tool that by
> default allows you to write something like
> ‘jsc /some/js/dir -o /some/build/dir –enable-jsx’
$ npm install --save browserify babelify babel-preset-es2015 babel-preset-react
$ browserify -t [ babelify --presets [ es2015 react ] ] \
main.js -o public/bundle.js
To incrementally recompile when a file changes: `npm install --save watchify` and replace `browserify` with `watchify` above.There are sets of tools that compose well and are easy to set up. I think developers hear about all these new techniques and think they need all of them, but it's much more important to know what you don't need and how to incrementally add pieces in small steps only when you need them and not before.
comment 10y ago · link · parent
With watchify:
watchify -p browserify-hmr -o bundle.js
With budo: budo main.js -p browserify-hmr
If you're using react, you'll only need a tiny wrapper around the root element to opt in to hot reloading: https://github.com/substack/react-starter-hmr/blob/master/ma...All of this should fit comfortably in a Makefile (or npm run script) and each piece you add is small and comprehensible.
comment 11y ago · link · parent
If you have a single mutable pointer, you can build a feed of data that points at immutable content by its hash, which could replace the data model of twitter, facebook, or many other social networking web services. The benefits to decentralized distribution are huge: native offline functionality, trivially transferable identity, longevity and robustness against providers shutting down, direct commerce without middlemen.
Payments, or perhaps ISP-style peering arrangements may help with the spam/large binary problem. A big part of distributing the data model will also involve distributing the costs, but this is somewhere non-profits like the Internet Archive can play a very important role.
comment 11y ago · link · parent
For me, virtual-dom + main-loop is a pretty great combo for front+back universal javascript. I made some repos about setting up virtual-dom, main-loop, routing, and browserify/watchify with npm run scripts:
* https://github.com/substack/virtual-dom-starter - bare-bones main-loop + virtual-dom setup * https://github.com/substack/virtual-dom-universal-starter - universal (front+back)end js example with shared routing and single-page pushState
I usually use an ordinary EventEmitter to rig up the unidirectional flow (but I dislike how "flux" makes this a big deal). Here's an example of that: https://github.com/substack/virtual-dom-unidirectional-examp...
If jsx is your thing, I made an example of setting up jsx in virtual-dom land too: https://github.com/substack/virtual-dom-starter-babel-es6-js...
As far as the research questions go for 1-3, I don't think sampling people about their subjective opinions will lead to any interesting findings, but for question #4:
I chose virtual-dom and main-loop because each piece has a singular concern and performs that concern well. I don't want to use a tool that does a bunch of unrelated things because I want to be confident that in the future I can discard pieces of my tooling at will as my requirements change. With bigger tools with larger scope that is not so easy.
comment 11y ago · link · parent
https://docs.npmjs.com/misc/scope#associating-a-scope-with-a...
Some of the other commercial npm hosts and open source offerings already support scoped packages.
comment 11y ago · link · parent
The way that npm has structured things, programmers pay once for membership in a commercial tier, where presumably money is already changing hands to work on private code. I think this makes much more sense and won't bias the code itself in a negative direction.
comment 11y ago · link · parent
https://oaklandwiki.org/Why_are_there_helicopters_right_now%...
comment 11y ago · link · parent
> PFS for message objects, as the description above suggests, is far more difficult, and contrary to the nature of email.
It recommends just rotating public keys every few days with a paranoid mode. A much better solution is to implement the Axolotl Ratchet pioneered by Open Whisper Systems for TechSecure:
https://www.whispersystems.org/blog/advanced-ratcheting/
https://github.com/trevp/axolotl/wiki
With Axolotl Ratchet, you get:
* forward secrecy - disclosure of private keys doesn't let an attacker in the future go back and read encrypted communication
* future secrecy - disclosure of ephemeral private keys doesn't disclose (much) future content
I also get the feeling from a glance reading the spec that way too much trust is being placed on service providers. That there is even such a category as "trustful" where the server has access to your private keys is a huge red flag and that was exactly the problem with lavabit: http://www.thoughtcrime.org/blog/lavabit-critique/
comment 11y ago · link · parent
49.
Offline decentralized single sign-on in the browser(substack.net ↗)
3 points · by substack · 11y ago · 1 comment
50.
Sentimental versioning(sentimentalversioning.org ↗)
31 points · by substack · 12y ago · 9 comments
comment 12y ago · link · parent
I don't think this problem is related to any cognitive burden, but is an artifact of how the package manager works and how easy it is to liberally publish packages. Consider npm, where people publish packages with little to no coordination and everything is mostly fine (whatever the author of the parent article says). Because it's so easy to make an npm account (anybody can `npm adduser` and start publishing immediately) and so easy to publish (just pick an unused name, make a package.json, and `npm publish`), people routinely make very granular packages, often just a single function. Importantly, these functions don't need to fit into a taxonomy namespace like in haskell which prevents namespace hierarchy turf wars for the lesser price of namespace landgrabs.
Better still, you can have multiple different versions of a library in the same application. In your example, libB would just get the version of libA that its constraints satisfy but elsewhere other libraries could depend on a version of libA that do not satisfy the constraints on libA that libB requires because every package gets their own copy of their dependencies, with automatic deduping when the constraints are satisfied to save space.
53.
Feed Open Source(feedopensource.com ↗)
69 points · by substack · 12y ago · 24 comments
54.
Task automation with `npm run`(substack.net ↗)
16 points · by substack · 13y ago · discuss
comment 13y ago · link · parent
var tr = require('trumpet')();
tr.createReadStream('article > span')
.pipe(process.stdout);
var request = require('request');
request.get('http://www.echojs.com').pipe(tr);
Bonus: I just noticed a simple bug in the selector engine from running your intended code that I just fixed in trumpet@1.5.6.56.
Sharing rendering code in node and the browser(substack.net ↗)
6 points · by substack · 13y ago · discuss
comment 13y ago · link · parent
comment 13y ago · link · parent
But module systems and package managers change everything about how open source ecosystems work! When you've got a package manager that is trivially easy to publish to, you remove pressure on libraries upstream to include extra functionality into their cores because users have too hard of a time fetching the functionality for themselves otherwise. With pervasive package management and a culture modularity, modules can be smaller because they can depend on other modules instead of inlining functionality or otherwise being overly cautious about dependencies. Convergence under this kind of fitness landscape tends toward narrowly-focused single-purpose libraries that do just one thing and do it well.
Popular frameworks have already severely dwindled in size from something extjs, mootools, or yui scale towards something backbone-sized. I sincerely hope that frameworks dwindle away into nothingness so that focused, reusable libraries that take simple inputs and produce simple outputs can fill the gap because the severe orthogonality and opportunities for novel recombination are so much greater!
60.
Browserify v2 released(browserify.org ↗)
43 points · by substack · 13y ago · 13 comments