Skip to content

Instantly share code, notes, and snippets.

View hirokazumiyaji's full-sized avatar

Hirokazu Miyaji hirokazumiyaji

View GitHub Profile
@hirokazumiyaji
hirokazumiyaji / vimrc
Created January 10, 2020 09:23
my vimrc config
if &compatible
set nocompatible
endif
language message C
" Key mapping
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
package http;
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import okhttp3.OkHttpClient
import okhttp3.Request
import reactor.core.publisher.Mono
class Client(val httpClient: OkHttpClient = OkHttpClient(), val mapper: ObjectMapper = jacksonObjectMapper()) {
@hirokazumiyaji
hirokazumiyaji / web.conf
Created December 13, 2017 07:23
nginx webp conf
server {
listen 80;
server_name localhost;
location ~ ^/assets/images/.+\.(?:gif|jpg|png)$ {
if ($http_accept ~* "webp") {
add_header Vary Accept;
rewrite (.+)\.(?:gif|jpg|png) $1.webp last;
}
if ($http_user_agent ~* "(Chrome|Opera|Android|Android.*Chrome)") {
@hirokazumiyaji
hirokazumiyaji / cf.yaml
Last active August 30, 2017 15:06
cloud formation example
AWSTemplateFormatVersion: 2010-09-09
Description: VPC Network Template
Parameters:
ServiceName:
Type: String
Description: Service name use resource tag and name field etc.
Default: example
EnvName:
Type: String
Description: environment
package com.github.gist.hirokazumiyaji;
import java.util.concurrent.TimeUnit;
import io.micrometer.core.instrument.Timer;
import io.micrometer.spring.web.MeterRegistry;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
@hirokazumiyaji
hirokazumiyaji / index.html
Created August 17, 2017 06:52
vuejs form confirm
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta charset="UTF-8">
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
</head>
<body>
<div id="app">
@hirokazumiyaji
hirokazumiyaji / config.toml
Created July 12, 2017 14:36
redis cluster tool config prototype
[[cluster]]
server = "127.0.0.1:6379"
[[cluster]]
server = "127.0.0.1:6380"
[[cluster]]
server = "127.0.0.1:6381"
[[cluster]]
package divide;
public class Divider {
private final String inputFilePath;
private final String outputFileDirectory;
private final Map<String, FileWriter> outputWriters = new HashMap<>();
package main
type Client struct {
Service *ec2.Ec2
InstanceId string
}
func newClient() (*Client, error) {
s := session.New()
md := ec2metadata.New(s)
@hirokazumiyaji
hirokazumiyaji / Application.java
Created May 30, 2017 07:38
Spring Boot jar file directory
package com.example.demo;
import java.nio.file.Paths;
import java.io.File;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {