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
YUI.add('sm-widget-parent-renderqueue', function(Y) { | |
/** | |
* Plugin for WidgetParent that uses an async-queue to render children | |
* | |
* @module widget-parent-render-queue | |
*/ | |
var NAME = 'renderqueue', | |
HOST = 'host', |
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
#!/bin/bash | |
# updates resolv.dnsmasq.conf with DHCP provided DNS servers for the | |
# currently active network interface on OS X | |
# the location of the dnsmasq resolv file | |
RESOLV=/etc/resolv.dnsmasq.conf | |
# get the list of active services from scutil | |
SERVICES=$(echo 'show Setup:/Network/Global/IPv4' | scutil | grep -e '[[:digit:]] :' | awk '{print $3}') |
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
// Browsers behave differently when dbl clicking to select | |
// a range. | |
// | |
// Chrome and IE use the text node that contains the selected text | |
// as the startContainer with an offset to exclude any whitespace | |
// characters at the start of the node. | |
// | |
// Firefox will use a text node *before* the selected text | |
// as the startContainer, with a positive offset set to the end | |
// of the node. If there is no previous sibling of the selected text |
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 | |
abstract class Base { | |
protected static function test() { | |
echo get_called_class()."\n"; | |
} | |
} | |
class Foo extends Base { | |
protected static function test2(){ |
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 | |
abstract class Base { | |
protected $name = 'Base'; | |
} | |
class Foo extends Base { | |
// defining $name here will properly fatal on access violation | |
// protected $name = 'Foo'; |
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 Version 5.6.11 | |
-------------------------------------------------- | |
Testing null over 100,000 iterations: | |
control 16.100883483887 | |
!$value 22.799968719482 | |
isset($value) 21.697998046875 | |
null !== $value 22.647142410278 | |
!empty($value) 22.5830078125 |
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
Lee@maverick ~$ php --version | |
PHP 5.4.28 (cli) (built: May 8 2014 10:11:53) | |
Copyright (c) 1997-2014 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies | |
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans | |
Lee@maverick ~$ php arraycasttest.php | |
-------------------------------------------------- | |
Testing null over 100,000 iterations: | |
is_array($value) 81.238031387329 ms |
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 Version 5.4.30 | |
------------------------------------------------------- | |
Testing 10 item array over 1,000 iterations: | |
array_diff_key 1.2109279632568 | |
loop/unset 0.87404251098633 | |
------------------------------------------------------- | |
Testing 100 item array over 1,000 iterations: |
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 Version 5.4.30 | |
-------------------------------------------------- | |
Testing 10 item array over 1,000 iterations: | |
serialize 2.1979808807373 ms | |
json_encode 1.3420581817627 ms | |
var_export 1.9409656524658 ms | |
msgpack_pack 1.5850067138672 ms | |
-------------------------------------------------- |
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 Version 5.4.29 | |
-------------------------------------------------- | |
Testing large_array over 100,000 iterations: | |
pass_by_ref 95.081090927124 ms | |
pass_by_val 86.126089096069 ms | |
-------------------------------------------------- | |
Testing small_array over 100,000 iterations: |
OlderNewer