Skip to content

Instantly share code, notes, and snippets.

View polidog's full-sized avatar
🌎

Ryota Mochizuki polidog

🌎
View GitHub Profile
@polidog
polidog / app.js
Created March 23, 2013 14:47
DNode+cakephp用のapp.js
/**
* Module dependencies.
*/
var express = require('express')
, cake = require('./routes/cake')
, http = require('http')
, path = require('path');
@polidog
polidog / cake.js
Created March 23, 2013 14:48
Dnode+cakephpのイベントハンドラ系処理
var dnode = require('dnode');
exports.requestAction = function(req, res){
dnode.connect(7070).on('remote',function(remote){
remote.callAction('/',null,{'domain':'localhost:3000'},function(html){
// console.log(html);
res.set('Content-Type', 'text/html');
res.send(html);
});
});
<?php
/**
* 実行したいメソッドに対してフィルター機能を提供する
* @version 0.0.1
* @author polidog <[email protected]>
*
* @property mixed $object 実行するクラスのインスタンス
* @property boolean $isExecuteProtectMethod private, protectedなメソッドを実行するかのフラグ
*/
@polidog
polidog / Lemon.php
Last active December 15, 2015 22:49
<?php
abstract class Lemon {
protected $__isNigata2Properties;
protected $__isFinalProperties;
public function __construct() {
$this->__isNigata2Properties = array();
$this->__isFinalProperties = array();
@polidog
polidog / HttpRequest.php
Created April 19, 2013 18:25
普通にHttpRequestクラス書いてみた。curl必須ね。
<?php
/**
* HttpRequestクラス
* @property array $CURL_OPTS default curl options*
* @property array $lastHttpResponse 最後のリクエスト情報
* @property array $options そのたcurlの設定情報
*/
class HttpRequest {
/**
<?php
function double_hash($key1, $key2, $salt = null, $callback = "sha1") {
if (!is_numeric($key1) || !is_numeric($key2)) {
return false;
}
$key1 = (int)$key1;
$key2 = (int)$key2;
$first = null;
@polidog
polidog / composer.json
Last active December 17, 2015 13:59
google-api-php-clientの為のcomposerの設定。もちろんautoloadも対応してるお!
{
"autoload": {
"psr-0": {
"": "src/"
},
"classmap": ["vendor/google/google-api-php-client/src"]
},
"repositories": [
{
"type": "package",
@polidog
polidog / composer.json
Last active December 17, 2015 13:59
Backlogのリポジトリをインストールする方法
{
"autoload": {
"psr-0": {
"": "src/",
"Polidog\\": "vendor/polidog/test/src"
},
},
"repositories": [
{
"type": "package",
/*
html2image 0.0.1 <http://html2canvas.hertzen.com>
Copyright (c) 2013 Ryota Mochizuki (@polidog)
Fork by
html2canvas 0.4.0 <http://html2canvas.hertzen.com>
Copyright (c) 2013 Niklas von Hertzen (@niklasvh)
Released under MIT License
*/
@polidog
polidog / example.html
Last active December 20, 2015 22:19
leapMotionでスワイプがleftかrightかupかdownかを判定するためのjQueryプラグイン
<!DOCTYPE html>
<html lang="ja">
<head>
<title>example</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div id="name">