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 / 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
@kaz29
kaz29 / phpinfo.txt
Created July 9, 2017 03:00
azure functions phpinfo
phpinfo()
PHP Version => 5.6.30
System => Windows NT RD00155E20242C 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586
Build Date => Jan 18 2017 19:41:45
Compiler => MSVC11 (Visual C++ 2012)
Architecture => x86
Configure Command => cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x86\instantclient_12_1\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
Server API => Command Line Interface
Virtual Directory Support => disabled