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 | |
mkdir('ftp://user:pass@localhost/path/to/dir'); |
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 | |
$files = glob('/path/to/dir'); | |
$files = array_filter($files, 'is_file'); |
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
$text = 'a | |
b | |
c | |
d | |
f | |
'; |
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 | |
class ConstantTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @runInSeparateProcess | |
*/ | |
public function testConstant1() | |
{ | |
define('THIS_IS_CONSTANT', 'foo'); | |
$this->assertSame('foo', THIS_IS_CONSTANT); |
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
$ coffee -cj path/to/compiled/file.js file1 file2 file3 file4 |
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 | |
$stdin = file_get_contents('php://stdin'); | |
$data = json_decode($stdin, true); | |
// var_dump($data); | |
if ( is_array($data) === false ) | |
{ |
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
$ git clone https://github.com/moriyoshi/kmyacc-forked.git | |
Cloning into kmyacc-forked... | |
remote: Counting objects: 76, done. | |
remote: Compressing objects: 100% (60/60), done. | |
remote: Total 76 (delta 14), reused 76 (delta 14) | |
Unpacking objects: 100% (76/76), done. |
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 isLeapYear($year) | |
{ | |
return ( ( $year % 4 === 0 and $year % 100 !== 0 ) or $year % 400 === 0 ); | |
} | |
$years = range(2000, 2012); |
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 | |
$filename = '/path/to/file.php'; | |
$contents = file_get_contents($filename); | |
$tokens = token_get_all($contents); | |
$functions = array(); | |
while ( count($tokens) > 0 ) | |
{ | |
$token = array_shift($tokens); |
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 | |
interface ModelInterface | |
{ | |
/** | |
* Sets the value of a property. | |
* @param string $name | |
* @param mixed $value | |
* @return void | |
*/ |