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
func GenCA(name string) (certPEM, keyPEM []byte, err error) { | |
now := time.Now().UTC() | |
tmpl := &x509.Certificate{ | |
SerialNumber: big.NewInt(1), | |
Subject: pkix.Name{CommonName: name}, | |
NotBefore: now, | |
NotAfter: now.Add(caMaxAge), | |
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, | |
KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, | |
IsCA: 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
<?php | |
/** | |
* LRU is a system which cache data used last recently. | |
* see more: http://www.slideshare.net/t_wada/tddbc-exercise | |
*/ | |
class LRU | |
{ | |
protected $_cache = array(); |
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
var parser = require('url'); | |
var handlers = {}; | |
var Handler = function(callback) { | |
this.process = function(req, res) { | |
params = null; | |
return callback.apply(this, [req, res, params]); | |
} | |
} |
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
function color_test { | |
# Daniel Crisman's ANSI color chart script from | |
# The Bash Prompt HOWTO: 6.1. Colours | |
# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
# | |
# This function echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background |
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 | |
// in /app/bootstrap.phpunit.php: | |
require_once __DIR__.'/bootstrap.php.cache'; | |
require_once __DIR__.'/AppKernel.php'; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; |