Skip to content

Instantly share code, notes, and snippets.

@ngyuki
ngyuki / index.css
Last active August 29, 2015 14:04
CSRF slide
.red {
color: #f00;
}
.reveal .slides section .fragment.through {
opacity: 1;
}
.reveal .slides section .fragment.through.visible {
text-decoration: line-through;
@ngyuki
ngyuki / c.php
Last active August 29, 2015 14:04
php-zend-multibyte-bug
<?php
declare(encoding='UTF-8');
/* あああ */
?>
<?php
// composer require react/react:\*
require __DIR__ . '/vendor/autoload.php';
use React\EventLoop\Factory;
use React\Socket\Server as SocketServer;
use React\Http\Server as HttpServer;
use React\Http\Request;
use React\Http\Response;
@ngyuki
ngyuki / uopz-di-classes.php
Last active March 6, 2018 12:29
Example of uopz di experimental
<?php
interface SayInterface
{
public function say();
}
class Ore implements SayInterface
{
public function say()
{
@ngyuki
ngyuki / symfony-console-single.php
Last active August 29, 2015 14:03
symfony console single
<?php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MyApplication extends Application
<?php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
$commands = [];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$(function(){
$('#aaa').click(function(){
@ngyuki
ngyuki / fproxy.js
Last active December 31, 2015 00:19
node.js forward proxy example
var httpProxy = require('http-proxy');
var url = require('url');
var net = require('net');
var http = require('http');
process.on('uncaughtException', function (err) {
console.error('! uncaughtException: ' + err.stack);
});
#!/usr/bin/env bash
# example)
# ./phpunit-watch src/ tests/ -c tests/ --colors
set -e
set -u
function usage
{
function phpunit
{
local root="${PWD}"
while [ -n "${root}" ]; do
if [ -x "${root}/vendor/bin/phpunit" ]; then
break
fi
root="${root%/*}"
done