Skip to content

Instantly share code, notes, and snippets.

View daviddias's full-sized avatar

David Dias daviddias

View GitHub Profile
» npm test
> ethereum-libp2p@0.0.0 test /Users/daviddias/code/js-ethereum-libp2p
> PHANTOM=off gulp test
[18:57:19] Using gulpfile ~/code/js-ethereum-libp2p/gulpfile.js
[18:57:19] Starting 'test'...
[18:57:19] Starting 'test:node'...
[18:57:19] Starting 'libnode:start'...
[18:57:19] Finished 'libnode:start' after 127 ms
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) => {
@daviddias
daviddias / tmux-cheatsheet.markdown
Created July 17, 2016 19:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

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

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
var a = 'aaaa'
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
  • Getting Node.js running
    • Install
    • REPL
    • Your first Hello World
    • Reference material (documentation, channels, etc)
  • JS 101
    • Console
    • Strings
    • Values and variables
  • Using functions
✘ ⮀ ⭠ 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
// Load modules
var Hapi = require('hapi');
// Declare internals
var internals = {};