Skip to content

Instantly share code, notes, and snippets.

@sondreb
sondreb / custom-did-method-web5.ts
Created October 16, 2024 10:03
Custom DID Method for Web5.connect()
const customAgentVault = new HdIdentityVault({
keyDerivationWorkFactor: 210_000,
store: new LevelStore<string, string>({ location: `DATA/AGENT/VAULT_STORE` }),
});
await customAgentVault.unlock({ password });
const didApi = new AgentDidApi({
didMethods: [DidDht, DidJwk, DidStellar],
resolverCache: new AgentDidResolverCache({ location: `DATA/AGENT/DID_RESOLVERCACHE` }),
@sondreb
sondreb / jwk-39.ts
Created September 7, 2024 21:59 — forked from bnonni/jwk-39.ts
import { base64url } from '@scure/base';
import { entropyToMnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';
// Function to convert Base64URL string to Uint8Array
function base64UrlToUint8Array(b64url: string): Uint8Array {
return base64url.decode(b64url + '='.repeat((4 - (b64url.length % 4)) % 4));
}
// Function to convert the private key to a BIP39 mnemonic
@sondreb
sondreb / styles.scss
Created October 2, 2023 20:31
Angular Material 16+ custom light and dark theme
@use "@angular/material" as mat;
@use "sass:map";
@include mat.core();
$primary-palette: (
50: #fef7df,
100: #fdeaae,
200: #fcdc7a,
300: #fbd041,
@sondreb
sondreb / devops-docker-basic.txt
Created August 31, 2020 20:15
Most basic Azure DevOps pipeline and Dockerfile for ASP.NET Core with SPA (Angular/React)
azure-pipeline.yml:
name: Build and Push ($(Date:yyyyMMdd)$(Rev:.r))
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
@sondreb
sondreb / dojo-01-bitcoin
Created January 2, 2020 12:56
A quick coding dojo teaching some basics of Bitcoin
using NBitcoin;
using Newtonsoft.Json;
using Xunit;
namespace BitcoinDojo
{
public class Tests
{
[Fact]
public void BasicIdentityAndEncryptionUsingBitcoin()
using NBitcoin;
using System;
namespace Example
{
class Program
{
static void Main(string[] args)
{
// Merchant private key for their identity published on the Blockcore Hubs:
@sondreb
sondreb / install.sh
Created January 23, 2019 21:46
City Chain install
#!/bin/bash
# ------------------------------------------------------------------
# City Chain Setup Script
# Download and deploy City Chain daemon as a service
#
# Author: thecrypt0hunter
# License: MIT
# ------------------------------------------------------------------
NONE='\033[00m'
@sondreb
sondreb / docker-compose-yml
Created January 9, 2019 15:16
docker-compose for City Chain Nako Block Indexer
version: '2'
services:
nako:
container_name: city-nako
networks:
nakonet:
ipv4_address: 172.16.10.100
image: coinvault/nako
command: city
ports:
@sondreb
sondreb / docker-compose-yml
Created January 9, 2019 15:12
docker-compose for Stratis Nako Block Indexer
version: '2'
services:
nako:
container_name: stratis-nako
networks:
nakonet:
ipv4_address: 172.16.11.100
image: coinvault/nako
command: stratis
ports:
Verifying my Blockstack ID is secured with the address 1qYUwfvrfaxeqrsEgDResKQvsBBnSQVVF https://explorer.blockstack.org/address/1qYUwfvrfaxeqrsEgDResKQvsBBnSQVVF