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
| import time | |
| t1 = time.time() | |
| r = [] | |
| for i in range(1000000): | |
| r.append(i) | |
| t2 = time.time() - t1 |
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
| import sys | |
| o = "I'm string!" | |
| r = sys.getsizeof(o) | |
| print r |
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
| (function() { | |
| 'use strict'; | |
| // Code here... | |
| }()); |
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
| def bubble(list): | |
| length = len(list) - 1 | |
| sorted = False | |
| while not sorted: | |
| sorted = True | |
| for i in range(length): |
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 | |
| $regex = '/^\pL+( \pL+)*$/uD'; | |
| $values = array( | |
| 'John Smith', | |
| 'Jānis Bērziņš', | |
| 'Hack3r', | |
| 'I like periods.', | |
| ); |
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 | |
| const TIMES = 1000000; | |
| function bench($function, $times = null) { | |
| $times = $times !== null ? $times : TIMES; | |
| $begin = microtime(true); |
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
| /** | |
| * @author daGrevis | |
| */ | |
| (function($) { | |
| 'use strict'; | |
| $.fn.emptyForm = function() { | |
| return this.each(function() { |
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
| function a(b) { | |
| c = | |
| b | |
| .toLowerCase() | |
| .split(' ') | |
| .join('-') | |
| .replace(/[^A-Za-z-]+/, ''); | |
| console.log(c); |
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 | |
| class AutoModeler extends AutoModeler_Core { | |
| /** | |
| * Sets data and changes state to loaded. | |
| * | |
| * @param array Data | |
| * | |
| * @author daGrevis |
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 | |
| class Foo { | |
| protected function bar($a, $b) { | |
| } | |
| public static function bar() { | |
| } |