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
Old: 266.95534920692 | |
New: 132.84537982941 |
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 | |
$start = memory_get_usage(); | |
$a = str_repeat("Hello", 4242); | |
$middle = memory_get_usage(); | |
$b = $a; | |
$c = $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
<?php | |
namespace app\extensions\data\entity; | |
class Document extends \lithium\data\entity\Document { | |
/** | |
* Converts the data in the record set to a different format, i.e. an array. | |
* | |
* @param string $format currently only `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
<?php | |
class foo { | |
public function &bar(&$bar) { | |
return ++$bar; | |
} | |
public function __call($method, $params) { | |
return $this->bar($params[0]); | |
} |
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
{ | |
// Displays whitesace on the screen | |
"draw_white_space": "all", | |
// Rules are great for soft/hard limits | |
"rulers": | |
[ | |
80, | |
100 | |
], |
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
/** | |
* Define application view paths | |
*/ | |
protected function _init() { | |
$this->_render['renderer'] = 'File'; | |
$this->_render['paths']['template'] = '{:library}/views/{:controller}/'; | |
$this->_render['paths']['template'] .= '{:template}.{:type}.php'; | |
$this->_render['paths']['layout'] = '{:library}/views/layouts/default.{:type}.php'; | |
$this->_render['paths']['element'] = '{:library}/views/elements/{:template}.html.php'; | |
parent::_init(); |
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
module LazyEnumerator | |
include Enumerable | |
def initialize(data = []) | |
@data = data | |
@pointer = 0 | |
end | |
def each |
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
class attempt { | |
private String charset = "abcdefghijklmnopqrstuvwxyz"; | |
private int length = charset.length(); | |
private BufferedReader stdError; | |
private Process p; |
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
# ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0] | |
module Baz | |
def bar | |
puts "world" | |
end | |
end | |
class Foobar | |
include Baz | |
def bar |
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
class Foo | |
private | |
def self.bar | |
puts 'I broke your ruby' | |
end | |
end | |
Foo.bar # I broke your ruby |