Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Krebs KingCrunch

View GitHub Profile
View mbeans-solr6.x.json
{
"responseHeader": {
"status": 0,
"QTime": 3
},
"solr-mbeans": [
"CORE",
{
"Searcher@4363244[a_core] main": {
"class": "org.apache.solr.search.SolrIndexSearcher",
View result.txt
$ php some-bench.php
strtotime: 0.15609812736511
datetime: 0.31521701812744
datetime without instanciation: 0.11794400215149
custom: 0.70522284507751
View gist:37837d2994a45f22818a
Verifying that +kingcrunch is my blockchain ID. https://onename.com/kingcrunch
View composer.json
{
"name": "crunch/meta-symfony-standard",
"version": "2.2.1",
"license":"MIT",
"type": "metapackage",
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
@KingCrunch
KingCrunch / 1-loop.php
Created Aug 17, 2011
1-loop vs. 2-loop
View 1-loop.php
<?php
$array = array();
$c = 1000000;
for ($i = 0; $i <= $c; $i++) {
$array[] = $i;
}
$time = microtime(true);
for ($i = 0; $i <= $c; $i++) {
$array[$i] = $array[$i] * $array[$i];
View curry.php
<?php
function curry($f, $arg1) {
$args = func_get_args();
array_shift($args);
return function () use ($f, $args) {
$callArgs = func_get_args();
$args = array_merge($args,$callArgs);
return call_user_func_array($f,$args);
};
}
View callable.php
<?php
$array = array('array_map1','array_map2');
// old "lambda"
echo "---\nold lambda style 'create_function\n";
$createdFunction = create_function('$arg','echo $arg . PHP_EOL;');
$createdFunction('direct');
call_user_func($createdFunction, 'call_user_func');
array_map($createdFunction, $array);
View keybase.md

Keybase proof

I hereby claim:

  • I am KingCrunch on github.
  • I am kingcrunch (https://keybase.io/kingcrunch) on keybase.
  • I have a public key whose fingerprint is B6D0 28AD 9443 4BAC 969E 8EA6 82DA ED16 D04A EFAE

To claim this, I am signing this object:

@KingCrunch
KingCrunch / composer.json
Last active Aug 29, 2015
crunch/symfony-standard-meta
View composer.json
{
"name": "crunch/symfony-standard-meta",
"type": "metapackage",
"license": "MIT",
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.5.x-dev",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",