Skip to content

Instantly share code, notes, and snippets.

View mikeal's full-sized avatar
🏠
Working from home

Mikeal Rogers mikeal

🏠
Working from home
View GitHub Profile
@mikeal
mikeal / README.md
Last active January 26, 2019 22:56

Does this matter?

let myCid = await ipfs.dag.put({name: "Mikeal Rogers"})
let projectsCid = await ipfs.dag.put(
{ title: "A new post!",
content: "Opinions about things!"
author: {'/': myCid.toBaseEncodedString()}
}
)
@mikeal
mikeal / vue.config.js
Created April 24, 2018 22:39
Vue config file for Electron demo.
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.output.publicPath = `${process.cwd()}/dist/`
}
}
}
@mikeal
mikeal / package.json
Created April 24, 2018 22:34
Dev script for package.json Vue.js Electron demo.
{ "scripts":
{ "dev": "NODE_ENV=DEV vue-cli-service serve & sleep 5 && NODE_ENV=DEV electron app.js" }
}
@mikeal
mikeal / app.js
Created April 24, 2018 22:32
Application file for Vue.js Electron demo app.
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
let url
if (process.env.NODE_ENV === 'DEV') {
url = 'http://localhost:8080/'
} else {
url = `file://${process.cwd()}/dist/index.html`
}
@mikeal
mikeal / install.sh
Created April 24, 2018 22:28
Install step for Vue.js and Electron
npm install -g @vue/cli
vue create my-project
cd my-project
npm install electron
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
let url
if (process.env.NODE_ENV === 'DEV') {
url = 'http://localhost:8080/'
} else {
url = `file://${process.cwd()}/dist/index.html`
}
@mikeal
mikeal / r2.js
Last active April 21, 2023 17:13
HTTP Client Comparison
const r2 = require('r2')
let doJsonThing = async (path, propname) => {
let res = await r2(`http://api.com${path}`).json
return res[propname]
}
@mikeal
mikeal / byteStorage.js
Last active July 18, 2017 22:09
Potentially a better way to design streaming byte storage.
// Byte Storage as Content Addressable Storage
class ByteStorage {
async set (key, value) async {
// Send to temporary storage w/ random UUID
let tmpfile = randomFile()
let p1 = send(value, tmpfile)
// Also stream the value to a hasher
let p2 = send(value, /* streaming hashing function */ )
let values = await Promise.all(p1, p2)
@mikeal
mikeal / bread.md
Created February 7, 2017 04:29
My Bread

| Ingredient | Measure | Baker's Percentage | | Sifted White Flour (Red Fife) | 500g | 100% | | Water | | 70% | | Active Levain | 100g | 20% | | Salt | 11g | | |