Skip to content

Instantly share code, notes, and snippets.

View ShigeoTejima's full-sized avatar

Shigeo Tejima ShigeoTejima

View GitHub Profile
@ShigeoTejima
ShigeoTejima / foo-graphql.json
Created September 17, 2023 09:38
example for wiremock stub json file when use wiremock-graphql-extension v0.6.2
{
"request": {
"method": "POST",
"urlPath": "/foo/graphql",
"customMatcher" : {
"name" : "graphql-body-matcher",
"parameters" : {
"expectedJson" : "{ \"query\": \",query DemoQuery { demo { id name } }\" }"
}
}
@ShigeoTejima
ShigeoTejima / Cargo.toml
Created September 17, 2023 08:43
graphql_client + salesforce graphql + ok/error handling thinking
[package]
name = "demo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
graphql_client = { version = "0.13", features = ["reqwest"] }
serde = "1.0"
@ShigeoTejima
ShigeoTejima / Cargo.toml
Created September 16, 2023 22:41
axumでQueryのvalidationをしてみた。bar.rsの方はもっと簡潔にできないか...
[package]
name = "demo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
axum = "0.6.20"
hyper = "0.14"
@ShigeoTejima
ShigeoTejima / Demo.java
Last active August 9, 2023 19:28
Coding according to trace ProcessChangeEventHeader in pub-sub-api
// Demo.java
import com.google.protobuf.ByteString;
import com.salesforce.eventbus.protobuf.*;
import io.grpc.CallCredentials;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.Metadata;
import io.grpc.stub.StreamObserver;
import org.apache.avro.Schema;
@ShigeoTejima
ShigeoTejima / README
Last active November 21, 2022 23:51
mysqlのselect結果をshell変数に設定したりするサンプル
- #!/bin/bash と書いてますが、POSIXモードで動きます
- カラム名を出力しないために -N を付与
- -B で出力形式を変更。フィールド区切りはTAB。レコード区切りは改行
- 複数カラムや複数行の場合に、値の内容にタブや改行あるとつらい
- -X でXML形式に出力することもできる。その場合は jq や xmllint を利用か?
- エラーハンドリングが面倒
@ShigeoTejima
ShigeoTejima / gist:1bc51717032825ebdd08db6f7130e21b
Created September 30, 2021 03:49
log of sfdx run:function:start
% sfdx run:function:start
Building myfunction
20: Pulling from heroku/buildpacks
35807b77a593: Pulling fs layer
0a35e61b290a: Pulling fs layer
fcdac917cbb2: Pulling fs layer
36ca75b559e9: Pulling fs layer
2279c3e26b0c: Pulling fs layer
76fab9a1999c: Pulling fs layer
f66fe785e799: Pulling fs layer
@ShigeoTejima
ShigeoTejima / AppConfig.java
Last active November 19, 2020 11:17
send mail to AWS SES using spring boot
package org.test.demo;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AppConfig {
@ShigeoTejima
ShigeoTejima / DemoForm.java
Created September 16, 2015 05:20
spring boot correlation validation example - EitherRequired
package com.example.web;
import com.example.validation.EitherRequired;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ShigeoTejima
ShigeoTejima / test.html
Created February 12, 2017 16:36
loading wall example...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
@ShigeoTejima
ShigeoTejima / test.html
Created February 12, 2017 16:35
example control timeout, after submit form to iframe. ummm
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<script src="js/jquery-3.1.1.min.js"></script>
</head>
<body>
<div>