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 recursive_array_search($needle, array $haystack) { | |
foreach ($haystack as $key => $value) { | |
if ($value === $needle) { | |
return $key; | |
} | |
if (is_array($value)) { | |
$chideKey = recursive_array_search($needle, $value); | |
return [$key, $chideKey]; | |
} |
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
Nightmare = require 'nightmare' | |
request = require 'request' | |
fs = require 'fs' | |
Gyazo = require 'gyazo-api' | |
nightmare = Nightmare() | |
url = process.env.HATENA_COUNT_URL | |
filename = "./ss.png" | |
client = new Gyazo(process.env.GYAZO_TOKEN) |
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 | |
/** | |
* Created by PhpStorm. | |
* User: polidog | |
* Date: 2016/05/26 | |
*/ | |
namespace AppBundle\Twig\Excetsion; | |
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 | |
/* | |
* __invoke()を使う意味がわからなかったけど、よく考えたらcallableな引数渡すときに無名関数じゃなくて、オブジェクト | |
* そのものを渡したい時に使えそうだと思った。 | |
*/ | |
class Hoge { | |
public function __invoke(string $output) | |
{ | |
$this->exec($output); |
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 | |
namespace AppBundle\OAuth\ResourceOwner | |
use HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GenericOAuth2ResourceOwner; | |
use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken; | |
use Symfony\Component\HttpFoundation\Request; | |
use Buzz\Message\RequestInterface as HttpRequestInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
class YahooJpResourceOwner extends GenericOAuth2ResourceOwner |
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 | |
namespace AppBundle; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
use AppBundle\DependencyInjection\Compiler\YahooOAuthCompilerPass; | |
class AppBundle extends Bundle | |
{ |
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
var gulp = require('gulp'); | |
var exec = require('child_process').exec; | |
gulp.task('watch',function(){ | |
gulp.watch("./src/**/*.php").on('change',function(event){ | |
var command = "php-cs-fixer fix " + event.path + " --config-file=" + __dirname + "/.php_cs" | |
exec(command); | |
console.log("execute command: "+command); | |
}) | |
}); |
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
[Database] | |
driver = "mysql" | |
server = "" | |
user = "hoge" | |
password = "fuga" | |
database = "testgo" | |
charset = "utf8" | |
parseTime = "true" |
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 _symfony_console | |
php (find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1) | |
end | |
function _symfony_get_command_list | |
_symfony_console --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }' | |
end | |
complete -f -c "console" -a "(_symfony_get_command_list)" |
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
var empty = () => { | |
return (pattern) => { | |
return pattern.empty() | |
} | |
} | |
var cons = (value, list) => { | |
return (pattern) => { | |
return pattern.cons(value,list) | |
} |