Skip to content

Instantly share code, notes, and snippets.

@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);
@kaz29
kaz29 / CoMeeting.php
Created November 14, 2012 06:58
co-meeting hack
<?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);
@kaz29
kaz29 / gist:3776212
Created September 24, 2012 14:27
CakePHP nginx.conf sample
location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?url=$1 last;
break;
}
}
location ~ .php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
@kaz29
kaz29 / MyTestSegue.m
Created June 4, 2012 04:47
StoryBoard sample
//
// MyTestSegue.m
// StoryBoardTest
//
#import "MyTestSegue.h"
@implementation MyTestSegue
- (void)perform
@kaz29
kaz29 / EncryptBehavior.php
Created April 21, 2012 01:38
EncryptBehavior for CakePHP2.x
<?php
/**
* Encrypt behavior
*
*/
class EncryptBehavior extends ModelBehavior {
// Encryption settings
const CIPHER = MCRYPT_RIJNDAEL_128;
const MODE = MCRYPT_MODE_CBC;
@kaz29
kaz29 / git-completion.bash
Created March 28, 2012 06:58
git-completion.bash
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@kaz29
kaz29 / td-agetnt.sh
Created January 12, 2012 00:35
td-agent setup for NiftyCloud - CentOS 5.6 64bit Plain
#!/bin/sh
# apache,fluent-plugin-s2が依存するパッケージをインストール
yum -y install httpd.x86_64 \
libxml2-devel.x86_64 libxslt-devel.x86_64
# td-agent 用のリポジトリを登録
cat <<_EOT_ 1>/etc/yum.repos.d/td.repo
[treasuredata]
name=TreasureData