This file contains 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
// protoc ./*.proto --js_out=import_style=commonjs:./ --grpc-web_out=import_style=typescript,mode=grpcweb:./ | |
var pb = require('./grpc_pb'); | |
var svc = require('./grpc_grpc_pb'); | |
var grpc = require('@grpc/grpc-js'); | |
// 证书 | |
const tls = `-----BEGIN CERTIFICATE----- | |
-----END CERTIFICATE-----` |
This file contains 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
# 1. 安装tpm: mkdir -p ~/.tmux/plugins && cd ~/.tmux/plugins && git clone https://github.com/tmux-plugins/tpm | |
# 2. 按 prefix + I(大写) 来安装插件 | |
# 3. 安装 vim-obsession, 用 vundle 安装或: cd ~/.vim/bundle && git clone git://github.com/tpope/vim-obsession.git --depth 1 && vim -u NONE -c "helptags vim-obsession/doc" -c q | |
##### 以上需手工执行 ##### | |
## 修改 tmux-prefix 键: ctrl+b --> ctrl+a | |
set -g prefix C-a | |
unbind C-b | |
bind a send-prefix | |
#set-option -g prefix2 ` |
This file contains 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
//step1:初始一个counter, with help string | |
pushCounter = prometheus.NewCounter(prometheus.CounterOpts{ | |
Name: "repository_pushes", | |
Help: "Number of pushes to external repository.", | |
}) | |
//setp2: 注册容器 | |
err = prometheus.Register(pushCounter) | |
if err != nil { | |
fmt.Println("Push counter couldn't be registered AGAIN, no counting will happen:", err) |
This file contains 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 com.satya.arcoresample | |
import android.content.Context | |
import android.hardware.Sensor | |
import android.hardware.SensorEvent | |
import android.hardware.SensorEventListener | |
import android.hardware.SensorManager | |
import android.location.Location | |
import android.os.Build | |
import android.os.Bundle |
This file contains 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 ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"errors" | |
"io" | |
"io/ioutil" |
This file contains 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
if [[ -o login ]]; then | |
TMUX_PREFIX="" | |
if [[ ! -z "$TMUX" ]] ; then | |
# Via | |
# <http://blog.yjl.im/2014/12/passing-escape-codes-for-changing-font.html>: | |
TMUX_PREFIX='\ePtmux;\e' | |
TMUX_POSTFIX='\e\\' | |
fi | |
# Indicates start of command output. Runs just before command executes. |
This file contains 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 ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha1" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"fmt" |