Skip to content

Instantly share code, notes, and snippets.

David Dias daviddias

Block or report user

Report or block daviddias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example.js
const IPFS = require('ipfs')
const os = require('os')
const repoPath = os.tmpdir() + '/' + Math.random()
const node = new IPFS(repoPath)
node.init({}, (err) => {
if (err) { throw err }
node._repo.config.get((err, config) => {
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View Software Development Process and Managing It - PL Team Week Lisbon 2016.md

Software Development Process and Managing It

Introduction

  • We're growing in terms of team and the product
  • We're moving from "prototyping" to "production" --> our needs change
  • Need to shift our mindset to "delivering"
  • Need a way to manage all the 1001 endeavours we have

Introduction to Methodologies

View commented-version.js
var fs = require('fs');
var path = require('path');
// fs.readdir is an async func, it doesn't return any value
// see: https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback
// var lists = fs.readdir(process.argv[2], callback);
fs.readdir(process.argv[2], callback);
// it yields just a single list, not lists. That list is in fact an array
View dict passed
optionsheadpostputdeletetraceacceptaccept-charsetaccept-encodingacccache-controlageallow
connection
content-basecontent-encodingcontent-languagecontent-lengthcontent-location
ccontent-range
last-modifielocationif-unmodified-sinceexpiresfromhosif-matchif-modified-since
max-forwardspragmaproxy-authenticateproxy-authorizationrangereferer
retry-afterservertetrailertransfer-encodingupgrade
user-agentvaryviawarningwww-authenticatemethodgetstatus200 OKversioHTTP/1.1urlpublic
set-cookie
keep-aliveorigin100101201202205206300302303304305306307402405406407408409410411412413414415416417502504505203 Non-Authoritative Information204 No Content301 Moved Permanently400 Bad Request401 Unauthorized403 Forbidden404 Not Found500 Internal Server Error501 Not Implemented503 Service UnavailableJan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec 00:00:00 Mon, Tue, Wed, Thu, Fri, Sat, Sun, GMTchunked,text/html,image/png,im
View syllabus.md
  • Getting Node.js running
    • Install
    • REPL
    • Your first Hello World
    • Reference material (documentation, channels, etc)
  • JS 101
    • Console
    • Strings
    • Values and variables
    • Using functions
View demo.sh
✘ ⮀ ⭠ feat/bootstrap ⮀ ~/code/protocol-labs/_ipfs/js/js-ipfs ⮀
» ipfs files ls /
tests
npm-registry
⭠ feat/bootstrap ⮀ ~/code/protocol-labs/_ipfs/js/js-ipfs ⮀
» ipfs files ls /npm-registry
-
⭠ feat/bootstrap ⮀ ~/code/protocol-labs/_ipfs/js/js-ipfs ⮀
» ipfs files stat /npm-registry
QmWudm6RiNK6tg4kwcei8oXdEuLkPXnMeMaWbq7S33zYac
View try.sh
ipfs swarm connect /ip4/85.216.106.69/tcp/52267/ipfs/QmSyNirNSqfeSNv7LKgPx8qf9aQy9pfjphxGWXBCXsnbX5
hash=ipfs name resolve QmdNc4B89DxVeiuDKRN5bWdKsAPCmekgmJMkRSdUNa7x9z
ipfs files cp /ipfs/$hash /npm-registry
View npm ls
ipfs-api@2.4.1 /Users/david/Documents/code/ipfs/node-ipfs-api
├─┬ brfs@1.4.1
│ ├── quote-stream@1.0.2
│ ├── resolve@1.1.6
│ ├─┬ static-module@1.1.3
│ │ ├─┬ escodegen@1.3.3
│ │ │ ├── esprima@1.1.1
│ │ │ ├── estraverse@1.5.1
│ │ │ ├── esutils@1.0.0
│ │ │ └─┬ source-map@0.1.43
You can’t perform that action at this time.