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 'dart:async'; | |
import 'package:rxdart/rxdart.dart'; | |
void main() { | |
ZipStream([ | |
Stream.fromIterable(<int>[1, 2, 3, 4, 5, 6, 7]), | |
Stream.periodic(Duration(seconds: 1)) | |
], (_) => _.first).listen(print); | |
} |
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
def substrings_exist(line, size): | |
max_possible_offset = len(line) - size * 2 | |
for offset in range(0, max_possible_offset + 1): | |
border = offset + size | |
substring = line[offset:border] | |
the_rest_of_the_string = line[border:] | |
if the_rest_of_the_string.find(substring) != -1: | |
return True | |
return False |
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
URxvt.font: -*-terminus-medium-*-*-*-*-180-*-*-*-*-*-* | |
URxvt.scrollBar: false | |
URxvt.saveLines: 100000 | |
URxvt.background: black | |
URxvt.foreground: white | |
URxvt.termName: xterm | |
URxvt.transparent: false | |
Xcursor.size: 16 |
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 PdoArgs implements IteratorAggregate | |
{ | |
/** | |
* @var array | |
*/ | |
private $state; | |
public static function factory(string $username = null, string $password = null) |
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 Foo { | |
function bar() { | |
echo 'yo'; | |
} | |
} | |
namespace { | |
function myFunction(callable $c) { | |
$c(); |
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 IMappable { | |
} | |
class MyList<P extends IMappable> { | |
final List<P> _list; | |
MyList.fromJson(Map<String, dynamic> json, P func(v)) | |
: _list = new List<P>.from(json.values.map(func)); | |
P operator[] (int index) { | |
return _list[index]; |
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 | |
$foo = require __DIR__ . '/foo.php'; | |
var_dump($foo); | |
var_dump(isset($innerVar)); |
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 IntCollection { | |
private $items = []; | |
function set(int $a) { | |
$this->items[] = $a; | |
} | |
function sum(): int { | |
return array_sum($this->items); | |
} | |
} |
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
connect() { | |
return paginaton | |
.combineLatest(sorting) | |
.do(table.showSpinner) | |
map(tableState => AJAX.getPageFromDataSource(...tableState)) | |
.do(table.hideSpinner); | |
} | |
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 | |
echo "preparing test data file\n"; | |
if (!file_exists('tmp')) { | |
$s = ''; | |
for ($i = 0; $i < 1000000; $i++) { | |
$s .= rand() . 'asd'; | |
} | |
file_put_contents('tmp', $s); | |
echo "file generated\n"; | |
} else |