Skip to content

Instantly share code, notes, and snippets.

View OR13's full-sized avatar
💭
...

Orie Steele OR13

💭
...
View GitHub Profile
@OR13
OR13 / did-key-resolve.ts
Created May 28, 2020 16:54
DID Key Resolve Example
const didKeyDriver = require('did-method-key').driver();
const resolve = async (did: string, options: any) => {
const data = await didKeyDriver.get({
did,
});
const parsedDidDocument = JSON.parse(JSON.stringify(data));
return parsedDidDocument;
};
@OR13
OR13 / example-resolution.ts
Created May 28, 2020 16:41
Example DID Resolution
export interface IResolutionResponse {
didDocument: Buffer;
didDocumentMetaData: any;
resolverMetaData: any;
}
export interface IResolutionOptions {}
export const resolveBasic = async (
@OR13
OR13 / interop-links.md
Last active May 7, 2020 02:26
Interop Links
@OR13
OR13 / gist:45c55930caff9c05edf3eeabafa38951
Created February 20, 2020 00:41
Node.js Meetup Links
https://gpg.jsld.org/
https://lds.jsld.org/
https://schema.org/
https://did-key.web.app/
https://jsld.org/vc?editor=ewogICJAY29udGV4dCI6IFsKICAgICJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsCiAgICAiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjEiCiAgXSwKICAiaWQiOiAiaHR0cDovL2V4YW1wbGUuZ292L2NyZWRlbnRpYWxzLzM3MzIiLAogICJ0eXBlIjogWwogICAgIlZlcmlmaWFibGVDcmVkZW50aWFsIiwKICAgICJVbml2ZXJzaXR5RGVncmVlQ3JlZGVudGlhbCIKICBdLAogICJpc3N1ZXIiOiAiaHR0cHM6Ly9leGFtcGxlLmVkdSIsCiAgImlzc3VhbmNlRGF0ZSI6ICIyMDIwLTAyLTE5VDIzOjI1OjA2LjcxMVoiLAogICJjcmVkZW50aWFsU3ViamVjdCI6IHsKICAgICJpZCI6ICJkaWQ6ZXhhbXBsZTplYmZlYjFmNzEyZWJjNmYxYzI3NmUxMmVjMjEiLAogICAgImRlZ3JlZSI6IHsKICAgICAgInR5cGUiOiAiQmFjaGVsb3JEZWdyZWUiLAogICAgICAibmFtZSI6ICJCYWNoZWxvciBvZiBTY2llbmNlIGFuZCBBcnRzIgogICAgfQogIH0KfQ
@OR13
OR13 / example.html
Created January 3, 2020 21:54
Exampe JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name" : "Brent",
"makesOffer" : {
"@type" :"Offer",
"priceSpecification" : {
"@type" : "UnitPriceSpecification",
"priceCurrency" : "USD",
@OR13
OR13 / .gitignore
Last active December 5, 2019 18:44
JWS b64 Tests
node_modules
@OR13
OR13 / script.js
Last active October 30, 2019 22:43
Like all the people on bumble
setInterval(()=>{
if (Math.random() > .8){
this.document.getElementsByClassName('encounters-action encounters-action--dislike tooltip-activator')[0].click();
} else {
this.document.getElementsByClassName('encounters-action encounters-action--like tooltip-activator')[0].click();
}
}, 10 * Math.random() * 1000);
@OR13
OR13 / did_document.json
Created October 23, 2019 22:29
Spanning Example of DID Document Properties
{
"@context": "...",
"id": "did:example:alice",
"controller": ["did:example:bob", "did:example:carol"],
"publicKey": [
{
"id": "did:example:alice#keys-0",
"type": "Secp256k1EthereumAddressVerificationKey2018",
"controller": "did:example:alice",
"ethereumAddress": "..."
@OR13
OR13 / btrc-did.jsonld
Created September 16, 2019 15:50
BTRC DID with undocumented public key types
{
"@context": [
"https://schema.org/",
"https://w3id.org/security/v1",
"https://w3id.org/did/v1"
],
"id": "did:btcr:xxcl-lzpq-q83a-0d5",
"authentication": [
{
"type": "EcdsaSecp256k1SignatureAuthentication2019",
@OR13
OR13 / generateActors.js
Created June 18, 2019 02:39
Create Test Actors for Element
const generateActors = (count) => {
for (let i = 0; i < count; i++) {
const mks = new element.MnemonicKeySystem(element.MnemonicKeySystem.generateMnemonic());
const didUniqueSuffix = element.op.getDidUniqueSuffix({
primaryKey: mks.getKeyForPurpose('primary', 0),
recoveryPublicKey: mks.getKeyForPurpose('recovery', 0).publicKey,
});
const actor = {
'@context': 'https://schema.org',
'@type': 'Person',