Skip to content

Instantly share code, notes, and snippets.

@studioTeaTwo
studioTeaTwo / ssi_and_web5_jp.md
Created September 18, 2022 11:47
A Japanese translation of "Self Sovereign Identity, TBD, and Web5"(https://developer.tbd.website/blog/ssi-tbd-web5/)

Self Sovereign Identity(SSI)とは、2016年にクリストファー・アレン氏がそれまでアイデンティティコミュニティの人々の間で話し合われていたことから着想してブログ記事「Self-Sovereign Identityへの道」で詳細をまとめた、包括的な用語です。そのブログではSelf-Sovereign Identityの10の原則が定義されています。

  1. Existence ユーザーは独立した存在でなければならない。
  2. Control ユーザーは自分のアイデンティティをコントロールできなければならない。
  3. Access ユーザーは自分のデータにアクセスできなければならない。
  4. Transparency システムやアルゴリズムは透明でなければならない。
  5. Persistence アイデンティティは永続的なものでなければならない。
  6. Portability IDに関する情報およびサービスは持ち運び可能でなければならない。
  7. Interoperability IDは可能な限り広く使用できなければならない。
  8. Consent IDを使用するときに本人が同意しなければならない。
@studioTeaTwo
studioTeaTwo / charge.config
Created August 27, 2022 16:38 — forked from zerofeerouting/charge.config
my charge-lnd config file
[default]
strategy = static
base_fee_msat = 0
fee_ppm = 0
max_htlc_msat_ratio = 1
[private]
# the channel is private - i assume you're not a routing node
# I will not limit the transaction size
chan.private = true
const Observable$ = of(1).pipe(
tap(console.log),
delayWhenLoading(isLoading = true)
);
Observable$.subscribe();
const delayWhenLoading = <T>(isLoading: boolean, delayTime: number = defaultDelayTime): OperatorFunction<T, T> => {
return pipe(
delayWhen(() => {
@studioTeaTwo
studioTeaTwo / Emptiable.ts
Created September 9, 2019 16:56
return immediately if source response empty array. otherwise adding some rx functions.
// return immediately empty if source response empty array.
// otherwise adding some functions.
const Emptialbe = <T>(source: Observable<T[]>, additional: Observable<T[]>) => {
source.pipe(
switchMap(array => {
if (array.length === 0) {
return of(array)
} else {
return additional(array)
}

Keybase proof

I hereby claim:

  • I am studioteatwo on github.
  • I am teatwo (https://keybase.io/teatwo) on keybase.
  • I have a public key ASA5tRsvy3kVk1xAvkxWJbvn7qSxDUCmeMrdunfSl5SPvAo

To claim this, I am signing this object:

// library
type TransformFunction = (rawResponse: object) => object;
type TransformedEntity<T extends TransformFunction> = ReturnType<T
>;
// indivisual
function transform1(rawResponse: object) {
return {

Tree Shaking Principles

When designing code please keep these principles in mind

Enums for features are not-tree-shakable

Here is an example of code which is not tree shakable.

export function query<T>(
@studioTeaTwo
studioTeaTwo / core.js
Created February 9, 2018 03:04
abstract core.js after building and serving from https://github.com/robwormald/ivy-code-size
/**
* @license Angular v6.0.0-beta.3-67cf712
* (c) 2010-2018 Google, Inc. https://angular.io/
* License: MIT
*/
import { __assign, __extends } from 'tslib';
import { Observable } from 'rxjs/Observable';
import { merge } from 'rxjs/observable/merge';
import { share } from 'rxjs/operator/share';
import { Subject } from 'rxjs/Subject';
@studioTeaTwo
studioTeaTwo / json_params.rake
Last active September 16, 2017 12:28
rake task to generate json shema document for swaggard from ActiveRecord Object
# encoding: utf-8
namespace :json_params do
desc "create the definitions of json params"
task :generate => :environment do
# Custom Definitions
create('Session', "#{Rails.root}/app/controllers/params/session.rb",
nil,
{email: 'string', password: 'string'}
@studioTeaTwo
studioTeaTwo / build.js
Created November 9, 2016 08:06
build script by pure nodejs
const browserify = require('browserify'),
babelify = require('babelify'),
compressor = require('node-minify'),
fs = require('fs');
process.env.NODE_ENV = 'production';
// for development enviroment
// "watch": "watchify -t babelify ./app/javascripts/components/message/app.js -o ./public/js/build.js -d",
// "build-css": "node-sass --include-path scss ./app/stylesheets/components/message/main.scss ./public/css/style.css",