Skip to content

Instantly share code, notes, and snippets.

View alanshaw's full-sized avatar
🌶️
https://storacha.network

ash alanshaw

🌶️
https://storacha.network
View GitHub Profile
@alanshaw
alanshaw / bb.md
Created October 5, 2017 16:31
ButtyBuild notes

Idea

"ButtyBuild" - CI over scuttlebutt

  • Why?
    • Shared knowledge of build status
    • Resource
    • Platform
  • Containerised so no leakage/personal data access
  • Build your own projects, share output log
@alanshaw
alanshaw / tester-issues-to-md.js
Created October 10, 2017 12:01
Tester issues to Markdown
// npm i github-request-all github-url prompt debug
const request = require('github-request-all')
const parse = require('github-url')
const Prompt = require('prompt')
const debug = require('debug')('tester-issues-to-md')
function getRepoAndAccessToken (cb) {
const schema = {
properties: {
repo: { description: 'Github repo URL:' },
@alanshaw
alanshaw / sleep.js
Last active November 15, 2017 15:47
async/await sleep
module.exports = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
// usage: await sleep(5000)
@alanshaw
alanshaw / syntax.md
Created November 17, 2017 14:16
Atom template string syntax highlighting

Add language-babel package if you don't already have it then add html:text.html.basic to the "JavaScript Tagged Template Literal Grammar Extensions" field in settings to get it to highlight template strings prefixed with html.

@alanshaw
alanshaw / brave-dev.md
Created November 29, 2017 16:26
Brave browser development notes

If update your brave extension manifest:

rm -rf ~/Library/Application\ Support/brave-development
@alanshaw
alanshaw / window.ipfs-howto.md
Last active February 19, 2018 12:51
Creating applications using the `window.ipfs` feature of IPFS companion

Creating applications using window.ipfs

If a user has installed IPFS companion, window.ipfs will be available as soon as the first script runs on your web page, so you'll be able to detect it using a simple if statement:

if (window.ipfs) {  
  await ipfs.id()
} else {
  // Fallback
}
@alanshaw
alanshaw / finally.md
Last active April 5, 2018 18:26
When does finally run?
try {
  console.log('try')
} catch (err) {
  console.log('catch')
} finally {
  console.log('finally')
}

Git repo: z8mWaFiA3ZiXGAPg8vKUJpnsGMErzLyN5

Ethereum stuffs: https://github.com/ipfs/js-ipfs/tree/master/examples/explore-ethereum-blockchain

ipfs.dag.put({foo: {'/': 'zdpuAyTBnYSugBZhqJuLsNpzjmAjSmxDqBbtAqXMtsvxiN2v3'}, bar: [{'/': 'zdpuAsuRSADxdYpvsPGqxWchEfE1DmDriKAybJXZaNqgRuiDd'}, {'/': 'zdpuAtPTXsDdqXQ5Rjafu7PdDc92qrA99uaW7FGAD8qjZwUvR'}, 3]}, { format: 'dag-cbor', hashAlg: 'sha2-256' }, (err, cid) => console.log(cid.toBaseEncodedString()))
> zdpuAycaJMNLA7KrAd9YEiakZ4iCQqaSxErLT55QUbtcEDGei
@alanshaw
alanshaw / js-ipfs-compat.md
Last active August 8, 2018 13:49
js-ipfs <> js-ipfs-api <> interface-ipfs-core compatibility table
js-ipfs version js-ipfs-api version interface-ipfs-core version
0.28.2 20.2.1 0.64.3
0.29.0 22.0.0 0.66.3
0.31.0 23.0.0 0.75.1

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: