Skip to content

Instantly share code, notes, and snippets.

View yuya-matsushima's full-sized avatar
🏢
Working from Office

Yuya Matsushima yuya-matsushima

🏢
Working from Office
View GitHub Profile
snippet cc
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class `Cucfirst(expand("%"))` extends MY_Controller {
public function __construct()
{
parent::__construct();
}
@yuya-matsushima
yuya-matsushima / codeigniter.snippets
Created September 2, 2011 12:12
codeigniter用のvimスニペット
snippet cc
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class `Cucfirst(expand("%"))` extends MY_Controller {
public function __construct()
{
parent::__construct();
}
@yuya-matsushima
yuya-matsushima / ci_functions.vim
Created September 2, 2011 12:04
vimでCodeIgniterでhogehogeする為の関数。vimrcに追加または読み込む
function! Cucfirst(str)
return substitute(strpart(a:str,0,strlen(a:str)-4), '\w\+', '\u\0', "")
endfunction
function! CiFilePos(str)
if a:str =~ ".\.system.\."
return '.' . matchstr(a:str, "\/system/.*$")
elseif a:str =~ ".\.application.\."
return '.' . matchstr(a:str, "\/application/.*$")
else
@yuya-matsushima
yuya-matsushima / auto_navi.html
Created August 27, 2011 17:05
seezooのオートナビゲーションリンク出力HTML
<div class="sz_auto_navigation">
<ul class="h_nav">
<li>
<a href="http://e2esound.net/home" class="home current">HOME</a>
</li>
<li>
<a href="http://e2esound.net/blog" class="blog">blog</a>
</li>
<li>
<a href="http://e2esound.net/links" class="links">Links</a>
@yuya-matsushima
yuya-matsushima / ci_log.sed
Created August 21, 2011 08:46
CodeIgniterのLogをカラー表示にするsedスクリプト
#!/bin/sed -f
##Inspired http://d.hatena.ne.jp/y-kawaz/20110713/1310532417
## MEMO
# [0m reset
# [1m bold
# [3m italic
# [4m underline
# [5m blink
# [30m black
# [31m red
@yuya-matsushima
yuya-matsushima / bitbucketLatest_githubLatest.diff
Created August 20, 2011 23:04
CodeIgniterのbitbucket.orgの最新版とgithubで公開されたv2.0.3の差分
diff --git a/application/config/database.php b/application/config/database.php
--- a/application/config/database.php
+++ b/application/config/database.php
@@ -27,7 +27,8 @@
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
-| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7.
+| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
+| (and in table creation queries made with DB Forge).
<?php
class Utility_helper_tests extends TEST_Controller
{
function __construct()
{
parent::__construct();
}
// h() test
@yuya-matsushima
yuya-matsushima / MY_Unit_test.php
Created July 16, 2011 13:33
MY_Unit_test.php
<?php if( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Unit_test extends CI_Unit_test
{
public function __construct()
{
parent::__construct();
}
public function report($result = array())
@yuya-matsushima
yuya-matsushima / TEST_Controller.php
Created July 16, 2011 13:30
TEST_Controller.php
<?php
/* Test Controller
------------------------------------------------------------------------*/
/**
* TEST_Controller
*
* @author yterajima <[email protected]>
* @copyright Copyright(C)e2esound.com/yterajima
* @version 1.0
*/
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Profiler extends CI_Profiler
{
protected $_available_sections = array(
'benchmarks',
'memory_usage',
'get',
'post',
'queries',
'session_data',