Skip to content

Instantly share code, notes, and snippets.

@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
@kaz29
kaz29 / chatwork_to_slack.js
Last active December 12, 2016 04:29
Azure functions Chatwork to Slack
var request = require('request');
var Slack = require('slack-node');
module.exports = function (context, myTimer) {
var timeStamp = new Date().toISOString();
if(myTimer.isPastDue)
{
context.log('JavaScript is running late!');
}
@kaz29
kaz29 / docker-wordpress-mysql.json
Last active November 24, 2016 19:24
azure-quickstart-templates
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"newStorageAccountName": {
"type": "string",
"metadata": {
"description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
}
},
@kaz29
kaz29 / 101-function-app-create-dynamic.json
Last active November 24, 2016 08:17
azure-quickstart-templates
{
"$schema": "http://schemas.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wish to create."
}
},
@kaz29
kaz29 / custom_encode.swift
Last active August 26, 2016 00:52
Alamofireのカスタムエンコード
func makeCustomEncoding() -> ParameterEncoding {
return ParameterEncoding.Custom { requestConvertible, parameters in
func escape(string: String) -> String {
// MEMO: /, ? もエンコードされるようにオリジナルのコードに追加指定している
// see https://github.com/Alamofire/Alamofire/blob/master/Source/ParameterEncoding.swift#L220
//
let generalDelimitersToEncode = ":#[]@/?" // does not include "?" or "/" due to RFC 3986 - Section 3.4
let subDelimitersToEncode = "!$&'()*+,;="
let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
@kaz29
kaz29 / example.swift
Created August 26, 2016 00:49
Alamofire custom encode example
let url = "https://api.example.com/foo"
let paramaters = ["foo": "bar"]
let encoding = makeCustomEncoding()
Alamofire.request(.GET, url, parameters: parameters, encoding: encoding)
....
@kaz29
kaz29 / API.php
Last active June 21, 2016 01:24
NiftyCloud mobile backend (http://mb.cloud.nifty.com/) REST API用PHPサンプル push通知しかテストしてないです...。 全部POSTで処理してるので、push通知以外の場合は適宜直す必要あります。
<?php
namespace Nifty\Cloud\mBaaS;
class API
{
public $settings = [
'application_key' => null,
'client_key' => null,
'api_url' => 'https://mb.api.cloud.nifty.com/2013-09-01/',
'SignatureMethod' => 'HmacSHA256',
@kaz29
kaz29 / attributes_default.rb
Created April 22, 2013 00:09
fluentd plugin install cookbook memo みんなどうやってるんだろ?まだ、LWRPがよくわからないのでこれでごまかしてる
default["fluentd"]["path"] = '/usr/lib/fluent'
default["fluentd"]["plugins"] = []
@kaz29
kaz29 / build.xml
Last active December 14, 2015 16:38
(CakePHPとか)PHPのテストについての勉強会 - CakePHP2+Jenkinsで継続的インテグレーション
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build">
<target name="build" depends="prepare,lint,phploc,pdepend,phpcb,phpmd-ci,phpcs-ci,phpcpd,phpunit"/>
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="3">
<sequential>
<antcall target="pdepend"/>
@kaz29
kaz29 / CoMeeting.php
Last active December 9, 2015 22:28
co-meeting hack $ php list_groups.php でグループ一覧(グループ名、グループID、未読数)が表示されます。 cURLが必要です。
<?php
// 大分やっつけ感がある感じ...orz
class CoMeeting {
private $url = 'https://www.co-meeting.com';
private $cookie = null;
private $params = null;
public function __construct($config='config.php')
{
include($config);