Skip to content

Instantly share code, notes, and snippets.

@kaz29
kaz29 / build
Created August 19, 2021 21:33
swagger-ui on Azure Static Web App example
#!/bin/sh
if [ ! -d "$SOURCE_DIR/OUT" ];then
mkdir $SOURCE_DIR/out
fi
curl -OL https://petstore.swagger.io/v2/swagger.json --output swagger.json
cp node_modules/swagger-ui-dist/* $SOURCE_DIR/out/
cp swagger.json $SOURCE_DIR/out/
cp staticwebapp.config.json $SOURCE_DIR/out/
@kaz29
kaz29 / example.php
Last active April 8, 2020 22:06
祭日取得
<?php
use GuzzleHttp\Client;
function getHolidays($holidays_id, $start, $end, $api_key, $num = 50)
{
$url = "https://www.googleapis.com/calendar/v3/calendars/{$holidays_id}/events";
$query_string = "key={$api_key}&timeMin={$start}&timeMax={$end}&maxResults={$num}&orderBy=startTime&singleEvents=true";
$client = new Client();
$response = $client->request(
@kaz29
kaz29 / README.md
Created March 27, 2020 09:55
MySQLメモ

docker-compose.yml

** --secure-file-priv='/tmp'** を付けないとcsvを吐き出せない

version: '3.4'

services:
  mysql-test:
 container_name: mysql-test
@kaz29
kaz29 / composer.json
Created November 1, 2019 02:16
Create SAS
{
"name": "kaz/sastest",
"authors": [
{
"name": "Kaz Watanabe",
"email": ""
}
],
"require": {
"microsoft/azure-storage-blob": "^1.4",
FROM osrm/osrm-backend:v5.22.0
EXPOSE 5000
CMD ["osrm-routed", "--algorithm", "ch", "/srv/kanto-latest.osrm"]
@kaz29
kaz29 / Dockerfile
Created July 28, 2019 21:32
php-apache-5.2 with sqlite
FROM kaz29/centos5:latest
ENV PHP_VERSION 5.2.17
# Initial setup
RUN yum update -y
RUN yum groupinstall -y 'Development Tools'
# Apache installation
RUN yum install -y httpd httpd-devel
FROM php:7.1.17-cli-alpine3.7
RUN apk add --no-cache curl bash git tree \
&& { \
curl -sS https://getcomposer.org/installer; \
} | php \
&& mv composer.phar /usr/local/bin/composer \
&& echo "export PATH=~/.composer/vendor/bin:$PATH" >> /root/.bash_profile
RUN composer global require "symfony/console=v2.6.13" \
@kaz29
kaz29 / Article.php
Last active May 30, 2018 02:59
Swagger サンプル(example.sonはswagger-phpで生成したファイルです、swagger-uiに食わせるとAPIドキュメントがみられます。)
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Article Entity.
*
* @SWG\Definition(
* definition="Article",
@kaz29
kaz29 / ansible.cfg
Created March 13, 2018 21:10
Ansible custom module for ansible
[defaults]
transport=ssh
forks=10
library=./ansible/libs
[ssh_connection]
ssh_args=-o ControlMaster=auto -o ControlPersist=30m
scp_if_ssh=True
pipelining=True
@kaz29
kaz29 / AreaComponent.js
Created September 26, 2017 06:30
サンプル
import React from 'react'
import { Link } from 'react-router'
class AreaComponent extends React.Component {
constructor(props) {
super(props)
}
render() {
const { area } = this.props