This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Nru /home/tatsuya/DOWNLOAD/php/CodeIgniter_1.7.3/system/libraries/Cache/Cache.php ./system/libraries/Cache/Cache.php | |
--- /home/tatsuya/DOWNLOAD/php/CodeIgniter_1.7.3/system/libraries/Cache/Cache.php 1970-01-01 08:00:00.000000000 +0800 | |
+++ ./system/libraries/Cache/Cache.php 2011-03-20 06:22:57.267999183 +0800 | |
@@ -0,0 +1,216 @@ | |
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
+/** | |
+ * CodeIgniter | |
+ * | |
+ * An open source application development framework for PHP 4.3.2 or newer | |
+ * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Nru /home/tatsuya/DOWNLOAD/php/CodeIgniter_1.7.3/system/application/libraries/Cache/Cache.php ./system/application/libraries/Cache/Cache.php | |
--- /home/tatsuya/DOWNLOAD/php/CodeIgniter_1.7.3/system/application/libraries/Cache/Cache.php 1970-01-01 08:00:00.000000000 +0800 | |
+++ ./system/application/libraries/Cache/Cache.php 2011-03-20 07:28:52.003705893 +0800 | |
@@ -0,0 +1,216 @@ | |
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
+/** | |
+ * CodeIgniter | |
+ * | |
+ * An open source application development framework for PHP 4.3.2 or newer | |
+ * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pretty_date($time) { | |
$diff = time() - $time; | |
$day_diff = floor($diff / 86400); | |
if(is_nan($day_diff)) return ''; | |
if ($day_diff == 0) { | |
if ($diff < 60) { | |
return $diff . "second ago"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// bad example | |
$v = '0'; | |
if ( empty($v) ) { | |
echo '$v is blank.'; | |
} | |
// good example | |
$v = '0'; | |
if ( strlen($v)==0 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require jquery | |
$(function(){ | |
var $w = $(window); | |
var $h = $('html,body'); | |
var offset = $w.height(); | |
function canDraw($target, info) { | |
var top = $target.position().top; | |
if (info.st - offset <= top && top <= info.st + info.wh + offset) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- log4php-org/Logger.php 2010-07-27 03:21:18.705554189 +0900 | |
+++ log4php/Logger.php 2011-04-02 00:26:13.964032277 +0900 | |
@@ -77,6 +77,7 @@ | |
'LoggerAppenderMailEvent' => '/appenders/LoggerAppenderMailEvent.php', | |
'LoggerAppenderNull' => '/appenders/LoggerAppenderNull.php', | |
'LoggerAppenderPhp' => '/appenders/LoggerAppenderPhp.php', | |
+ 'LoggerAppenderRollingDailyFile' => '/appenders/LoggerAppenderRollingDailyFile.php', | |
'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php', | |
'LoggerAppenderSocket' => '/appenders/LoggerAppenderSocket.php', | |
'LoggerAppenderSyslog' => '/appenders/LoggerAppenderSyslog.php', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ hg clone parents | |
$ hg clone child | |
$ cd child | |
$ hg pull -u ../parents | |
$ hg merge | |
$ hg commit -m 'merge parents' |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Nru CodeIgniter_2.0.1/application/migrations/001_Create_accounts.php CodeIgniter_2.0.2/application/migrations/001_Create_accounts.php | |
--- CodeIgniter_2.0.1/application/migrations/001_Create_accounts.php 2011-03-16 02:53:58.000000000 +0800 | |
+++ CodeIgniter_2.0.2/application/migrations/001_Create_accounts.php 1970-01-01 08:00:00.000000000 +0800 | |
@@ -1,32 +0,0 @@ | |
-<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
- | |
-class Migration_Create_accounts extends CI_Migration { | |
- | |
- function up() | |
- { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#alias git | |
alias gia='git add' | |
alias gial='git add --all' | |
alias gic='git commit' | |
alias gicm='git commit -m' | |
alias gis='git status' | |
alias gips='git push' | |
alias gipl='git pull' | |
alias gich='git checkout' | |
alias gib='git branch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function test1($masters, $targets) { | |
$sd = microtime(true); | |
$intersects = array_uintersect_assoc($targets, $masters, 'compare_key'); | |
$ed = microtime(true); | |
return $ed-$sd; | |
} | |
function compare_key($key1, $key2) { | |
if ($key2 == $key1->id) { |
OlderNewer