This is a discussion repo for creating a spec and implemenation of an IPFS archive format. Please see the issues to join the conversation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var React = require('react/addons') | |
| var PouchDBUrl = require('../env.js').PouchDBUrl | |
| var PouchDB = require('pouchdb') | |
| PouchDB.plugin(require('pouchdb-authentication')) | |
| var db = new PouchDB(PouchDBUrl) | |
| var _ = require('lodash') | |
| // TODO: On Load: | |
| // Get the conversations needed -- Pass these through to the component | |
| // Get the date of the first (or last?) note in each conversation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports.getConversationPosts = exports.getConversationPosts = function getConversationPosts (conversation, cb) { | |
| return db.query(function (doc) { | |
| if (doc.conversation && doc.type && doc.type === 'note') { | |
| emit(doc.conversation) | |
| } | |
| }, {include_docs: true, key: conversation.id}).then(function (response) { | |
| // TODO This shouldn't be needed, the query should be doing this for us. | |
| // Actually, this isn't working at all. The conversation.id is undefined. | |
| console.log('conversation', response, conversation.id) | |
| return _.filter(justTheDocs(response), function (doc) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var readPDFText = function (documentObject, options, cb) { | |
| if (!documentObject) throw new Error('No pdf provided') | |
| // For each page | |
| async.map( | |
| pdfjs.getDocument(documentObject).then(function (pdf) { | |
| // Get all of the apges | |
| async.times(pdf.numPages, function (pageNum, callback) { | |
| pdf.getPage(pageNum + 1).then(function (page) { | |
| // Get all of the strings on the page |
I hereby claim:
- I am RichardLitt on github.
- I am richlitt (https://keybase.io/richlitt) on keybase.
- I have a public key whose fingerprint is 1070 2CDC E1A8 61C8 4EC6 B5F1 4EA1 CEF2 3B01 6E42
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function binSearch (dict, hunt) { | |
| var len = dict.length | |
| var half = Math.floor(len / 2) | |
| if (len === 1) { | |
| if (dict[0] === hunt) { | |
| return hunt | |
| } else { | |
| return null | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 10:05 ~/src/ipfs-community 🐕 git co master | |
| Switched to branch 'master' | |
| Your branch is up-to-date with 'origin/master'. | |
| 10:05 ~/src/ipfs-community 🐕 git pull | |
| remote: Counting objects: 11, done. | |
| remote: Compressing objects: 100% (11/11), done. | |
| remote: Total 11 (delta 2), reused 0 (delta 0), pack-reused 0 | |
| Unpacking objects: 100% (11/11), done. | |
| From github.com:ipfs/community | |
| 96a9229..34b44fe master -> origin/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Print out open cards from a given list */ | |
| function listCards (listName) { | |
| return Promise.try(function () { | |
| return getOpenLists() | |
| }).filter(function (list) { | |
| return list.name === listName | |
| }).then(function (list) { | |
| return t.getAsync('/1/lists/' + list[0].id, {cards: 'open'}) | |
| }).spread(function (list.cards) { | |
| // Here! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Print out open cards from a given list */ | |
| function listCards (listName) { | |
| return Promise.try(function () { | |
| return getOpenLists() | |
| }).filter(function (list) { | |
| return list.name === listName | |
| }).then(function (list) { | |
| return t.getAsync('/1/lists/' + list[0].id, {cards: 'open'}) | |
| }).then(function (list) { | |
| return Promise.map(list.cards, function (card) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Verifying that +richlitt is my blockchain ID. https://onename.com/richlitt |