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 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 |
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 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.getConversationsForUser = function (user, cb) { | |
| db.query(function (doc) { | |
| if (doc.author === user.userId) { | |
| emit(doc) | |
| } | |
| }.bind(this), {include_docs: true}).then(function (response) { | |
| console.log('response', response) | |
| cb(null, response) | |
| }).catch(function (err) { | |
| cb(err) |
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
| componentWillMount: function () { | |
| let dummyImage = 'http://upload.wikimedia.org/wikipedia/en/4/42/Richard_Feynman_Nobel.jpg' | |
| let userPromises = [] | |
| let clone = _.each(this.state.conversations.slice(), function (conversation) { | |
| conversation.avatars = [] | |
| _.each(_.keys(conversation.participants), function (key) { | |
| if (conversation.participants.hasOwnProperty(key)) { | |
| // Suggestion: Only show avatars for participants who have actively contributed to conversation | |
| let getAvatar = db.getUser(key).then(function (err, res) { | |
| if (res.avatar) { |
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
| cd .. | |
| printf 'cd to' && pwd | |
| echo 'Cloning BeagleLab/beagle-style' | |
| git clone git@github.com:BeagleLab/beagle-style.git | |
| cd beagle-style | |
| echo 'Installing modules...' | |
| npm install | |
| cd .. | |
| echo 'Cloning BeagleLab/beagle-pdf' | |
| git clone git@github.com:BeagleLab/beagle-pdf.git |
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
| # 2015 April 16th | |
| What am I trying to do? | |
| I have a Chrome extension and I want to implement OAuth in it so that users can be authenticated and have accounts. | |
| So, first, I need users. The user objects shouldn’t be too hard to implement. Juan sent me a way to do it. | |
| Then, I need to figure out how to use Google OAuth. Actually, this doesn’t require me hitting the API for the Google Contacts I need, I believe - I should be able to just use Google OAuth before I hit the API, as that is actually a separate concern. |
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
| db.get(documentId).then(function (value) { | |
| // if (err && err.name !== 'not_found') { | |
| // return console.log('Failed to get ' + documentId + 'from db', err) | |
| // } | |
| /* Instantiate the object if it doesn't exist yet */ | |
| value = value || {} | |
| value._id = documentId | |
| /* Add in the selection to the selections array */ |
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
| // Initiation of browserify object | |
| var b = browserify({ | |
| // Required watchify args | |
| 'cache': {}, | |
| 'packageCache': {}, | |
| 'fullPaths': true, | |
| // Browserify options | |
| 'entries': [paths.jsPath + 'main.js'], | |
| 'noParse': ['react.js', 'jquery.js', 'pdf.combined.js'], | |
| 'transform': [reactify] |