Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️
Remote working...

Carson Farmer carsonfarmer

🏖️
Remote working...
View GitHub Profile
View gist:5239bda72f051e3536db4e2051bef6de
import resolve from '@rollup/plugin-node-resolve';
export default {
input: 'index.js',
output: {
dir: 'output',
format: 'cjs',
},
onwarn: (error) => {
console.log(error);
@carsonfarmer
carsonfarmer / index.md
Last active Apr 22, 2021
Dynamic Data on IPFS: An Introduction to Buckets and Threads
View index.md

Dynamic Data on IPFS: An Introduction to Textile's Buckets and Threads

This document: https://tinyurl.com/ybk38mfh
Slides from intro presentation: https://tinyurl.com/y8hxgrq2

Description

In this workshop we’re going to cover tools for building engaging apps, for real users, dealing with real data. We’ll focus on JavaScript app building and we’ll show you simple and fast ways to add IPFS, IPNS, and even potentially Filecoin so you can create interoperable & unstoppable data for your users.

What we’ll cover:

We'll cover in introduction to Textile’s Threads, Buckets, and Hub tools. We’ll also cover some command-line (CLI) actions, and Textile’s JavaScript Client(s). To prepare, we encourage you to install a few things before we get started:

View Database.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am carsonfarmer on github.
  • I am carsonfarmer (https://keybase.io/carsonfarmer) on keybase.
  • I have a public key ASDg9OIITd2PRxa3AilDjevMta2t0QVv2d1ofwbC7_zwuwo

To claim this, I am signing this object:

@carsonfarmer
carsonfarmer / index.ts
Created May 11, 2019
Typescript verison
View index.ts
#!/usr/bin/env node
import { cac } from 'cac'
import textile, { Block, FeedItem } from '@textile/js-http-client'
import readline from 'readline'
import chalk from 'chalk'
import { emojify } from 'node-emoji'
const cli = cac('txtl')
const { log } = console
View step-five.diff
diff --git a/index.js b/index.js
index 963d96f..6e7bfc1 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,8 @@
const cli = require('cac')('txtl')
const textile = require('@textile/js-http-client').default
var readline = require('readline')
+const chalk = require('chalk')
+const { emojify } = require('node-emoji')
@carsonfarmer
carsonfarmer / step-four.diff
Created May 11, 2019
Flushing out the subscription step
View step-four.diff
diff --git a/index.js b/index.js
index 598b1d1..963d96f 100644
--- a/index.js
+++ b/index.js
@@ -31,7 +31,31 @@ cli.command('', 'Starts an interactive chat session in a thread.')
// Only subscribe to text events on the specified thread
textile.subscribe.stream(['TEXT'], opts.thread)
.then((stream) => {
- log('do something')
+ // All js-http-client stream endpoints return a ReadableSream
@carsonfarmer
carsonfarmer / step-three.diff
Created May 11, 2019
Adding some Textile functionality
View step-three.diff
diff --git a/index.js b/index.js
index 4cf1473..598b1d1 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,7 @@
#!/usr/bin/env node
const cli = require('cac')('txtl')
+const textile = require('@textile/js-http-client').default
var readline = require('readline')
@carsonfarmer
carsonfarmer / step-two.diff
Created May 11, 2019
Adding some interactivity
View step-two.diff
diff --git a/index.js b/index.js
index 11b46ac..4cf1473 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,7 @@
#!/usr/bin/env node
const cli = require('cac')('txtl')
+var readline = require('readline')
@carsonfarmer
carsonfarmer / index.js
Created May 11, 2019
Initial stub cmd-line tool
View index.js
#!/usr/bin/env node
const cli = require('cac')('txtl')
const { log } = console
// Create 'default' chat command
cli.command('', 'Starts an interactive chat session in a thread.')
.action((opts) => {
log('do something')