This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BigNumber } from "bignumber.js"; | |
| const serialized: any = { | |
| blockNumber: "8947598234759823", | |
| txs: [{ price: "45384238946427" }] | |
| }; | |
| class Transaction { | |
| price: BigNumber; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| vaultApi "github.com/hashicorp/vault/api" | |
| ) | |
| var ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: tx | |
| namespace: default | |
| --- | |
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: vault-auth-service-account | |
| namespace: default | |
| --- | |
| kind: ClusterRoleBinding | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| metadata: | |
| name: vault-auth-role-binding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: tx | |
| namespace: default | |
| --- | |
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| socket.on("push-operations", function(req) { | |
| const msg = Messages.BufferProxy.deserializeBinary(req); | |
| document.integrateOperations(msg.getOperationsList().map(deserializeOperation)); | |
| console.log("push-operations", document.getText()); | |
| socket.broadcast.emit("push-operations", req); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| editor.addEventListener("input", ({ target, data, inputType }) => { | |
| let start, end, text; | |
| if (inputType === "insertText") { | |
| start = { row: 0, column: target.selectionStart - 1 }; | |
| end = { row: 0, column: 0 }; | |
| text = data; | |
| } else if (inputType === "deleteContentBackward") { | |
| start = { row: 0, column: target.selectionStart }; | |
| end = { row: 0, column: target.selectionStart + 1 }; | |
| text = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.DEBUG = "node-vault"; // switch on debug mode | |
| require("dotenv").config(); | |
| const mysql = require("promise-mysql"); | |
| const Vault = require("node-vault"); | |
| const { VAULT_TOKEN } = process.env; | |
| const vault = Vault({ token: VAULT_TOKEN }); | |
| let credential; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| # Load .env variables | |
| export $(egrep -v '^#' .env | xargs) | |
| vault secrets enable database | |
| vault write database/config/my-database \ | |
| plugin_name=mysql-database-plugin \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| vault: | |
| image: vault:0.11.4 | |
| cap_add: | |
| - IPC_LOCK | |
| environment: | |
| - VAULT_DEV_ROOT_TOKEN_ID=${VAULT_TOKEN} | |
| ports: | |
| - 8200:8200 |