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 level = require('level') | |
| import * as encoding from 'lib0/dist/encoding' | |
| import * as decoding from 'lib0/dist/decoding' | |
| import * as syncProtocol from 'y-protocols/dist/sync.js' | |
| import * as authProtocol from 'y-protocols/dist/auth.js' | |
| import { createMutex } from 'lib0/dist/mutex.js' | |
| const mux = createMutex() | |
| function getEmptyEncodedStateVector() { |
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
| // has been got from http://stackoverflow.com/a/3410557/3097116 | |
| function getIndicesOf(searchStr, str, caseSensitive) { | |
| var startIndex = 0, searchStrLen = searchStr.length; | |
| var index, indices = []; | |
| if (!caseSensitive) { | |
| str = str.toLowerCase(); | |
| searchStr = searchStr.toLowerCase(); | |
| } | |
| while ((index = str.indexOf(searchStr, startIndex)) > -1) { | |
| indices.push(index); |
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
| var http = require("http"); | |
| var domain = require("domain"); | |
| function log() { | |
| var args = [].slice.call(arguments); | |
| args.unshift(process.uptime()+"s:"); | |
| console.log.apply(console, args); | |
| } | |
| var agent = new http.Agent({ |
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 | |
| function grab($url) { | |
| $page = file_get_contents($url); | |
| if(preg_match('@<div class="cover-container">(.+?)</div>@', $page, $m)) { | |
| if(preg_match('@src\s*=\s*"(.+?)"@', $m[1], $m)) { | |
| return $m[1]; | |
| } | |
| } | |
| return null; |