Skip to content

Instantly share code, notes, and snippets.

View suin's full-sized avatar
😃

suin

😃
  • Craftsman Software, Inc.
  • Japan Tokyo
View GitHub Profile
@suin
suin / gist:3891076
Created October 15, 2012 06:31
XOOPS 構造変更案

1 オーソドックス

xoops_trust_path/modules/xcore
├── actions
├── admin
├── blocks
├── class <-- ここに現在の html/core を入れ込む
├── forms
├── images
@suin
suin / SampleTest.php
Created September 24, 2012 08:46
PHPUnitとかで使えるかもしれないモックHTTPサーバー
<?php
function do_request($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$result = curl_exec($ch);
@suin
suin / gist:3497946
Created August 28, 2012 13:26
(MacOS) sudo fs_usage <apache_proccess_id>
22:24:45.340122 accept F=3 F=60 0.000008 httpd.365955
22:24:45.340127 fcntl F=60 <GETFD> 0.000001 httpd.365955
22:24:45.340127 fcntl F=60 <SETFD> 0.000001 httpd.365955
22:24:45.340168 read F=60 [ 35] 0.000002 httpd.365955
22:24:45.341836 read F=60 B=0x1e7 0.000007 httpd.365955
22:24:45.341917 stat64
^_^)/ {/tmp/php-yaf/tools/cg) (master) (5.4.5)
$ php yaf_cg
Yaf Code Generetor Version 1.0.0
Usage:
yaf_cg ApplicationName [ApplicationPath]
^_^)/ {/tmp/php-yaf/tools/cg) (master) (5.4.5)
$ php yaf_cg foo
DONE
^_^) {/Users/suin) (5.4.5)
$ cd /tmp
^o^) {/tmp) (5.4.5)
$ git clone git://github.com/laruence/php-yaf.git
Cloning into 'php-yaf'...
remote: Counting objects: 407, done.
remote: Compressing objects: 100% (290/290), done.
remote: Total 407 (delta 203), reused 302 (delta 98)
Receiving objects: 100% (407/407), 215.75 KiB | 65 KiB/s, done.
svn
# ディレクトリを作成して移動mkdir -p $HOME/local/src/subversion
cd $HOME/local/src/subversion/
# ソースDL
wget http://www.apache.org/dist/subversion/subversion-1.7.3.tar.gz
# 展開
tar xzf subversion-1.7.3.tar.gz
<?php
class ChangeThemeByModule extends XCube_ActionFilter
{
public function postFilter()
{
$dirname = null;
if ( isset($this->mRoot->mContext->mModule->mXoopsModule) and is_object($this->mRoot->mContext->mModule->mXoopsModule) ) {
$dirname = $this->mRoot->mContext->mModule->mXoopsModule->get('dirname');
}
#!/bin/bash
original_dir=$(pwd)
rm -rf /tmp/xoopsilex*
mkdir /tmp/xoopsilex || exit 1
cd /tmp/xoopsilex
git clone git://github.com/suin/xoopsilex-sample.git xoopsilex-sample-tmp
wget -O - https://github.com/xoopscube/legacy/tarball/r2_2_01_Beta_3 | tar xzf -
mkdir xoopsilex-sample || exit 1
mv xoopscube-legacy-*/* xoopsilex-sample/
@suin
suin / gist:3137258
Created July 18, 2012 16:20
[update-query] token log example

https://github.com/suin/update-query

$ cat 20120719_0113~suin.apply_token 
-- [2012-07-19 01:13:44] update-query create 'suin'
-- [2012-07-19 01:13:58] update-query cat "20120719_0056_fuga.sql" >> "patch.suin.20120719_0113.sql"
-- [2012-07-19 01:13:58] update-query cat "20120719_0056_hoge.sql" >> "patch.suin.20120719_0113.sql"
-- [2012-07-19 01:13:58] update-query cat "20120719_0056_pugya.sql" >> "patch.suin.20120719_0113.sql"
-- [2012-07-19 01:13:58] update-query mv 20120719_0013~suin.apply_token 20120719_0113~suin.apply_token
#!/usr/bin/env php
=======================================
XoopsUnit Installer
=======================================
<?php
$installer = new XoopsUnitInstaller();
$installer->run();
class XoopsUnitInstaller