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 | |
trait AbstractSpeak | |
{ | |
abstract protected function speak($string); | |
} | |
trait PrintSpeak | |
{ | |
protected function speak($string) |
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 -r '$a=[]; $a["1.1"]=1; $a[1.1]=2; var_dump($a);' | |
array(2) { | |
'1.1' => | |
int(1) | |
[1] => | |
int(2) | |
} | |
php -r '$a="0x12"; $a++; var_dump($a);' | |
int(19) | |
php -r '$a="012"; $a++; var_dump($a);' |
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
ideサポート | |
intellijのideであるphpstormがサポートをしようとしている。 | |
https://youtrack.jetbrains.com/issue/WI-21737 | |
fix versiosには9.0が付いているので、うまくいけば2015年末にリリースされるであろうphpstorm 9.0に含まれる。 | |
hhvm 3.3からxdebugが含まれるようになったことも含め、今後のide対応に期待が高まる。 | |
async/await サポート | |
http://hhvm.com/blog/7091/async-cooperative-multitasking-for-hack | |
便利そう(小並感) |
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
Ti.include 'qunit/qunit.js' | |
Ti.include 'qunit/qunit-tap.js' | |
qunitTap QUnit, (message) -> | |
Ti.API.info message | |
xhr = Ti.Network.createHTTPClient() | |
xhr.open 'POST', 'http://192.168.3.2:5000/tap', false | |
xhr.send tap : message | |
, noPlan: 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
use 5.12.1; | |
use warnings; | |
use Plack::Request; | |
use Router::Simple; | |
use FindBin; | |
use AnyEvent::Util qw(run_cmd); | |
my $router = Router::Simple->new(); | |
my @tap = (); | |
my $builder = "/Library/Application Support/Titanium/mobilesdk/osx/1.6.2/iphone/ |
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
Index: sapi/cli/php_cli_server.c | |
=================================================================== | |
--- sapi/cli/php_cli_server.c (revision 318210) | |
+++ sapi/cli/php_cli_server.c (working copy) | |
@@ -571,6 +571,12 @@ | |
sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp TSRMLS_CC); | |
efree(tmp); | |
} | |
+ { | |
+ char *tmp; |
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
$it = new CallbackFilterIterator( | |
new ArrayIterator(range(1, 10)), | |
function($v){ return $v % 2 == 1;} | |
); | |
foreach($it as $value) { | |
var_dump($value); | |
} |
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 | |
interface Foo { | |
function test(); | |
} | |
interface Bar { | |
function test(); | |
} |
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
#!/usr/bin/env perl | |
$buf = ''; | |
while(<STDIN>) { | |
$flag = $_ =~ m/^\s+0x[\da-f]{4}: /; | |
if (!$flag) { | |
$buf =~ s/\s//g; | |
$buf =~ s/[0-9A-Fa-f][0-9A-Fa-f]/pack("C", hex $&)/eg; | |
$buf = substr($buf, 52); |
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 array_slide(&$array, $key, $amount) { | |
if ($amount === 0) { | |
return; | |
} | |
$keys = array_keys($array); | |
$values = array_values($array); | |
$target = array($keys[$key] => $values[$key]); | |
$left = array_slice($array, 0, $key); |
OlderNewer