Does this matter?
View example.js
class NeedsReady { | |
constructor () { | |
this.ready = new Promise(resolve => setTimeout(resolve, 1000)) | |
} | |
async foo () { | |
await this.ready | |
return 'bar' | |
} | |
} |
View stateless-interface.js
class Database { | |
constructor (storage) { | |
this.count = 0 | |
this.storage = storage | |
} | |
async get (cid) { | |
this.count += 1 | |
return this.storage.get(cid.toBaseEncodedString()) | |
} | |
async put (block) { |
View script.zsh
aws logs describe-log-streams --log-group-name="/aws/lambda/ghmetrics-staging-get-filter" --query 'logStreams[*].l│·········· | |
ogStreamName' --output table | awk '{print $2}' | grep -v ^$ | while read x; do aws logs delete-log-stream --log-stream-name="$x" --log-group-name="/a│·········· | |
ws/lambda/ghmetrics-staging-get-filter"; done |
View vue.config.js
module.exports = { | |
configureWebpack: config => { | |
if (process.env.NODE_ENV === 'production') { | |
config.output.publicPath = `${process.cwd()}/dist/` | |
} | |
} | |
} |
View install.sh
npm install -g @vue/cli | |
vue create my-project | |
cd my-project | |
npm install electron |
View sample.js
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()} | |
} | |
) |
View package.json
{ "scripts": | |
{ "dev": "NODE_ENV=DEV vue-cli-service serve & sleep 5 && NODE_ENV=DEV electron app.js" } | |
} |
View app.js
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` | |
} |
View app.js
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` | |
} |