Skip to content

Instantly share code, notes, and snippets.

🔥
gRPC, Kubernetes, GCP, AWS, Azure, Firebase / Go, Javascript, Rust <- new!

Soichi Sumi soichisumi

🔥
gRPC, Kubernetes, GCP, AWS, Azure, Firebase / Go, Javascript, Rust <- new!
Block or report user

Report or block soichisumi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@soichisumi
soichisumi / README.md
Created Jul 15, 2019
an example of gcp service account
View README.md

GCP Service Account Example

this is an example of gcp service account. Clearly, service account has a private key and a certificate.

So GCP uses public-key cryptography (+ certificate to validate wheather public key is falsificated) to authenticate the service account.

@soichisumi
soichisumi / showFields.js
Created Jun 24, 2019
object の fieldの中身を列挙する. Objectがundefinedなパラメータがないかどうかのチェックのときに使用する
View showFields.js
function showFields(target) {
for (var f in target) {
console.log(`${f}: ${target[f]}`);
}
}
@soichisumi
soichisumi / horizon-client-example.go
Last active Jun 4, 2019
an example of stellar/go/horizonclient and conversion of Embedded.Records / [Stellar] [Go]
View horizon-client-example.go
package main
import (
"encoding/json"
"fmt"
"github.com/stellar/go/clients/horizonclient"
"github.com/stellar/go/protocols/horizon/operations"
)
View azure-k8s-snippets.md

install azure-cli

  1. brew update && brew install azure-cli
  2. az login

load credential to kubectl

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

load credetial to docker-cli

az acr login --name <acrName>

View warmup-function.js
const functions = require('firebase-functions');
const rp = require('request-promise');
const projectId = process.env.GCP_PROJECT;
const region = 'us-central1';
// GCF の List API を利用するためのサービスアカウント
// service account をリポジトリに含めたくない場合は下記のように機密データを取得する
// 設定方法: https://github.com/firebase/firebase-tools/issues/406#issuecomment-353017349
const serviceAccount = functions.config().list.cert;
@soichisumi
soichisumi / firestore-listen-query.go
Created Dec 4, 2018
example of listening firestore realtime update in golang
View firestore-listen-query.go
package main
import (
"firebase.google.com/go"
"cloud.google.com/go/firestore"
"context"
"log"
"fmt"
)
@soichisumi
soichisumi / firestore-listen-doc.go
Last active Dec 2, 2018
example of listening firestore realtime update
View firestore-listen-doc.go
package main
import (
"firebase.google.com/go"
"cloud.google.com/go/firestore"
"context"
"log"
"math/rand"
"fmt"
)
View jayson-promise.js
// jayson-promise-test
const jayson = require(`jayson/promise`);
const client = jayson.client.https(`http://url`);
client.request(`sendrawtransaction`, [`02000000000101e704a7202bd63642b45234d1d132fcd72112789a1caa08c3b6843d7d2e94b211010000001716001421aa1728d096147222c201519a8710fd1bc2f416ffffffff01405489000000000017a91400853f1aefada64964a3f602846d263f5f3630a98702483045022100dc5051daf71e46c4e297e66c4b71f8d2fb3359dc209f24ca598677215318867502203b131875c948dd996a0575b0600e3b702d29de9ac7853c388319e20babe2d7b00121038bf0cde309b16f3513725515f077178e8ff8b89269543555057edc28b16179cd00000000`])
.then((res)=>{console.log(JSON.stringify(res))})
.catch((err)=> {
console.log(JSON.stringify(err));
console.log(String(err));
if(String(err).startsWith(‘Error: ’)){
const str = String(err).slice(7);
View sleep-promise.js
function sleep(millisec) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, millisec);
});
}
@soichisumi
soichisumi / dogrun.txt
Created Sep 20, 2018
dogrun 質問 メモ
View dogrun.txt
dogrun
01 gcpとfirebaseのfunctionの使い分け
・function自体は同じ、違いは開発者のデプロイ方法の違い
02 functionでpythonサポートの予定はあるか
頑張るが今の所ない。
03 firebaseとgcpの壁
・モバイルならfirebase、クラウドならgcp、functionsは中間
・schedulerをfirebaseに持て来るよていはある
You can’t perform that action at this time.