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
function onFormSubmit(e) { | |
const headers = { | |
outline: "Outline", | |
expected: "What's the expected result?", | |
actual: "What's the actual result?", | |
howToReproduce: "Steps to reproduce the issue", | |
details: "Additional details", | |
email: "Email Address", | |
}; | |
const title = e.namedValues[headers.outline][0]; |
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
#!/bin/bash -eux | |
if [ $# -ne 3 ]; then | |
echo "./generate.sh USER_NAME CLUSTER_NAME HOSTNAME" 1>&2 | |
exit 1 | |
fi | |
USER_NAME=$1 | |
CLUSTER_NAME=$2 | |
HOSTNAME=$3 |
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
#!/bin/bash -eux | |
if [[ $UID != 0 ]]; then | |
echo "Please run this script with sudo" | |
exit 1 | |
fi | |
REGISTRIES_YAML_PATH=/etc/rancher/k3s/registries.yaml | |
if [ -e $REGISTRIES_YAML_PATH ]; then |
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
# -e: encryption, -base64 (-a): use base64 encoding/decoding, -pass: `pass:xxx` sets the password `xxx` to encrypt/decrypt, -p: print salt, key, IV | |
echo "hello" | openssl enc -aes-128-cbc -e -base64 -pass pass:test -p | |
# salt=FE03CBE926FC4070 | |
# key=FFF339A34C98ED8D8B8843E3F1846104 | |
# iv =EAEAD799A571F360BA1C17B335E2701F | |
# U2FsdGVkX1/+A8vpJvxAcFEj7ilI/zfrmA3EZ5VQUeY= | |
# -d: decryption | |
echo "U2FsdGVkX1/+A8vpJvxAcFEj7ilI/zfrmA3EZ5VQUeY=" | openssl enc -aes-128-cbc -d -base64 -pass pass:test -p | |
# salt=FE03CBE926FC4070 |
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 ( | |
"fmt" | |
"log" | |
"math/rand" | |
"time" | |
) | |
const DIM = 26 // |{'a', ..., 'z'}| = 26 |
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
#!/bin/bash -eux | |
if [ $# -ne 3 ]; then | |
echo "./generate.sh USER_NAME CLUSTER_NAME HOSTNAME" 1>&2 | |
exit 1 | |
fi | |
USER_NAME=$1 | |
CLUSTER_NAME=$2 | |
HOSTNAME=$3 |
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
/* | |
MariaDB [hoge]> call populate_timedim(); | |
Query OK, 7200 rows affected (8.972 sec) | |
MariaDB [hoge]> select * from timedim limit 10; | |
+----+---------------------+ | |
| id | ts | | |
+----+---------------------+ | |
| 1 | 2020-08-27 08:00:00 | | |
| 2 | 2020-08-27 08:00:01 | |
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
class ActiveRecordWithConnectionInterceptor < ::GRPC::ServerInterceptor | |
def request_response(**) | |
# ref: https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L54-L56 | |
::ActiveRecord::Base.connection_pool.with_connection do | |
yield | |
end | |
end | |
alias_method :server_streamer, :request_response | |
alias_method :client_streamer, :request_response |
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 ( | |
"bufio" | |
"crypto/md5" | |
"encoding/hex" | |
"fmt" | |
"math/big" | |
"os" | |
) |
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
// ErrorCapturer specifies the implementation of a method to capture the given error | |
type ErrorCapturer interface { | |
CaptureError(err error, tags map[string]string) string | |
} | |
// SentryRavenInterceptor creates an interceptor which catches the errors from each service method and reports them to Sentry | |
func SentryRavenInterceptor(ec ErrorCapturer) grpc.UnaryServerInterceptor { | |
return func(ctx context.Context, req interface{}, _info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { | |
resp, err := handler(ctx, req) | |
if err != nil { |