- Shinji tanaka / hatena CEO
- githubやってるよ
- history
- 2001/7 京都にて創業
- 2004/2 Tokyo
This file contains hidden or 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 | |
| /** | |
| * convert 20120102 to 2012-1-2 | |
| * | |
| * @return string | |
| */ | |
| function convertDate($date) { | |
| $dateInfo = date_parse_from_format('Ymd', $date); | |
| return $dateInfo['year'] . '-' . $dateInfo['month'] . '-' . $dateInfo['day']; | |
| } |
This file contains hidden or 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 | |
| /** | |
| * check 8-digits-date is correct | |
| * | |
| * @param string $date | |
| * @return boolean | |
| */ | |
| protected function checkDate($date) | |
| { | |
| $len = strlen($date); |
This file contains hidden or 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 | |
| /** | |
| * SplClassLoader implementation that implements the technical interoperability | |
| * standards for PHP 5.3 namespaces and class names. | |
| * | |
| * http://groups.google.com/group/php-standards/web/final-proposal | |
| * | |
| * // Example which loads classes for the Doctrine Common package in the | |
| * // Doctrine\Common namespace. | |
| * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); |
This file contains hidden or 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 | |
| $ary1 = array( | |
| 'matsu' => 'ary1 matsu', | |
| 'take' => 'ary1 take', | |
| 'ume' => 'ary1 ume', | |
| 'ary1' => 'ary1 value', | |
| ); | |
This file contains hidden or 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 | |
| /** | |
| * if there is no http_response_code function (PHP 5 >= 5.4) | |
| * define own http_response_code function. | |
| * refs. http://www.php.net/manual/ja/function.http-response-code.php#107261 | |
| */ | |
| if (!function_exists('http_response_code')) { | |
| /** | |
| * @param string $code http response code | |
| */ |
This file contains hidden or 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 base64_urlsafe_encode($val) { | |
| $val = base64_encode($val); | |
| return str_replace(array('+', '/', '='), array('_', '-', '.'), $val); | |
| } | |
| function base64_urlsafe_decode($val) { | |
| $val = str_replace(array('_','-', '.'), array('+', '/', '='), $val); | |
| return base64_decode($val); |
This file contains hidden or 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
| // see. http://blog.asial.co.jp/659 | |
| <script type="text/javascript"> | |
| /** | |
| * コールバック | |
| */ | |
| function myfunc(json) { | |
| var box = $('#twitterBox'); | |
| $(json.results).each(function(i, v) { | |
| v.jp_created_at = dateJp(v.created_at); |
This file contains hidden or 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_beautifier --filters "ArrayNested NewLines(before=if:switch:T_COMMENT)" -f filename.php |
This file contains hidden or 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
| function orderFade() { | |
| $("div:hidden:first").fadeIn('fast', function () { | |
| orderFade() | |
| }); | |
| } | |
| orderFade(); |