Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am zgorizzo69 on github.
  • I am zgorizzo (https://keybase.io/zgorizzo) on keybase.
  • I have a public key ASCIZDjlJhutVMIubCahARZYZI0_p_pDL_rVK1bnA5Cp7go

To claim this, I am signing this object:

@zgorizzo69
zgorizzo69 / testAddress
Last active December 7, 2017 10:13
ethereum
0x627306090abaB3A6e1400e9345bC60c78a8BEf57
Verifying my Blockstack ID is secured with the address 18i5dXhP2rPCQFGjhQentVwpYSgDZNQ8Gr https://explorer.blockstack.org/address/18i5dXhP2rPCQFGjhQentVwpYSgDZNQ8Gr
@zgorizzo69
zgorizzo69 / judeid.js
Last active November 13, 2018 11:38
jude.id
{
address: "16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg",
blockchain: "bitcoin",
did: "did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-1",
expire_block: 597093,
grace_period: false,
last_txid: "d44f72b157352fc33fa78f84d16c9e4704074c92596bb645a9b262922511f9ec",
renewal_deadline: 602093,
resolver: null,
status: "registered",
var CryptoJS = require("crypto-js");
const zonefile = '$ORIGIN jude.id\n$TTL 3600\n_https._tcp URI 10 1 \"https://raw.githubusercontent.com/jcnelson/profile/master/jude.id\"\n_https._tcp URI 10 1 \"https://www.cs.princeton.edu/~jcnelson/jude.id\"\n';
const zonefilehash = cryptoJS.RIPEMD160(cryptoJS.SHA256(this.zonefile));
console.log(zonefilehash);
@zgorizzo69
zgorizzo69 / authentication.js
Last active November 14, 2018 18:15
blockstack authentication
/*
Every app that uses multi-player storage must add itself to the user's profile.json file.
The Blockstack Browser will handle this part automatically when the publish_data scope is requested during authentication.
to read a another user file, you just need to call getFile with the appropriate options:
const options = { username: username, decrypt: false, zoneFileLookupURL: 'https://core.blockstack.org/v1/names/'}
getFile(statusFileName, options)
*/
signIn() {
const origin = window.location.origin;
@zgorizzo69
zgorizzo69 / search.js
Created November 14, 2018 18:23
blockstack search and lookup
private searchUrl = 'https://core.blockstack.org/v1/search';
public searchContacts(queryValue: string): Observable<ContactSearchResult[]> {
if (!queryValue || queryValue.trim().length < 1) {
return of(new Array<ContactSearchResult>());
}
return this.http.get<BlockstackSearchResponse>(this.searchUrl, { params: { query: queryValue.trim() } })
.pipe(
map((r: BlockstackSearchResponse) => {
return r.results.map(i => this.mapToSearchResult(i));
})
@zgorizzo69
zgorizzo69 / authresponsetoken.js
Last active November 14, 2018 19:48
blockstack publickey inside authresponsetoken
{
header: {
alg: "ES256K"
typ: "JWT"
},
payload: {
core_token: null,
email: null,
exp: 1544801401,
hubUrl: "https://hub.blockstack.org",
@zgorizzo69
zgorizzo69 / gaia.storage.service.js
Last active November 16, 2018 12:10
gaia blockstack storage service example
import { Injectable } from '@angular/core';
import * as blockstack from 'blockstack';
import { Observable, from, of } from 'rxjs';
import { tap, map, catchError } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class StorageService {
@zgorizzo69
zgorizzo69 / reservation_zos.sh
Last active June 3, 2019 14:11
error while reserving zos on testnet branch development_installer
JSX> res = w.capacity.reserve_zos_vm('[email protected]','t1000.example','ac1f6b457338',2)
1
Mon 03 14:09:13 BCDB.py - 428 - bcdb:bcdb : load model:
jumpscale.threefold_directory.client
Mon 03 14:09:13 BCDB.py - 428 - bcdb:bcdb : load model:
jumpscale.gedis.client
Mon 03 14:09:13 GedisClient.py - 138 - j.clients.gedis:gedisclient : redisclient
: notary.grid.tf:5000
Traceback (most recent call last):
File "<stdin>", line 1, in <module>