This file contains hidden or 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
| Object.prototype.extends = function(options) { | |
| var element = this; | |
| Object.getOwnPropertyNames(options).forEach(function(property) { | |
| if(!element.hasOwnProperty(property)) { | |
| element[property] = options[property]; | |
| } | |
| }); | |
| } | |
| Object.prototype.extends({ |
This file contains hidden or 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
| HTMLElement.prototype.load = function() { | |
| var element = this; | |
| var request = new XMLHttpRequest(); | |
| request.addEventListener('readystatechange', function(event) { | |
| element.dispatchEvent(event); | |
| }, false); | |
| request.open('GET', this.href); | |
| request.send(); | |
| } |
This file contains hidden or 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 | |
| var_dump(crypt('foobar', '$2a$08$1234')); | |
| var_dump(crypt('foobar', '$2a$08$123456789012345678901')); | |
| var_dump(crypt('foobar', '$2a$08$123456789012345678901$')); | |
| var_dump(crypt('foobar', '$2a$08$1234567890123456789012')); | |
| var_dump(crypt('foobar', '$2a$08$12345678901234567890123')); | |
| ?> |
This file contains hidden or 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 | |
| var_dump(crypt('foobar', '$2a$08$123456789012345678901')); | |
| var_dump(crypt('foobar', '$2a$08$123456789012345678901$')); | |
| var_dump(crypt('foobar', '$2a$08$1234567890123456789012')); | |
| var_dump(crypt('foobar', '$2a$08$12345678901234567890123')); | |
| ?> | |
This file contains hidden or 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 | |
| /** | |
| * Pick first non empty element in array | |
| * | |
| * @param array $array | |
| * @param function $callback | |
| * @return mixed | |
| */ | |
| function array_pick($array, $callback = NULL) { |
This file contains hidden or 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 | |
| $foo = array(6, 5, 4, 3, 2, 1); | |
| $bar = $foo { | |
| $foo[2] | |
| }; | |
| var_dump($bar); |
This file contains hidden or 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 Blar; | |
| /** | |
| * @link http://docs.amazonwebservices.com/AWSECommerceService/2010-11-01/DG/ | |
| */ | |
| class Amazon { | |
| protected $token; |
This file contains hidden or 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 | |
| switch(array_filter(array(gettype($foo), is_object($foo) ? get_class($foo) : NULL))) { | |
| case array('integer'): | |
| var_dump('integer'); | |
| break; | |
| case array('object', 'foo'): | |
| var_dump('foo'); |
This file contains hidden or 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
| array(2) { | |
| [0]=> | |
| object(Blar\HTTP\Response)#213 (3) { | |
| ["url":protected]=> | |
| NULL | |
| ["headers":protected]=> | |
| array(5) { | |
| ["Status"]=> | |
| object(Blar\HTTP\Headers\Status)#216 (3) { | |
| ["protocol"]=> |
This file contains hidden or 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
| # | |
| # Encoding: Unicode (UTF-8) | |
| # | |
| CREATE TABLE `activity_like` ( | |
| `activity_id` int(11) NOT NULL, | |
| `like_id` int(11) NOT NULL, | |
| PRIMARY KEY (`activity_id`,`like_id`), | |
| KEY `IDX_AFA79B2181C06096` (`activity_id`), |