Moved to dedicated repository.
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
declare module chrome.usb { | |
type Direction = 'in' | 'out'; | |
interface Device { | |
device: number, | |
vendorId: number, | |
productId: number, | |
productName: string, | |
manufacturerName: string, | |
serialNumber: string |
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
function *bitflags() { | |
for (let i = 1; i <= 31; i <<= 1) { | |
yield i; | |
} | |
throw new RangeError('Too many bitflags.'); | |
} | |
const [STARTED, CLOSE_REQUESTED, PULLING, PULL_AGAIN, DISTURBED] = bitflags(); |
This file has been truncated, but you can view the full file.
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
exports.include = [ | |
{ | |
options: {}, | |
regexp: /&ad_box_|&ad_channel=|&ad_classid=|&ad_height=|&ad_keyword=|&ad_network_|&ad_number=|&ad_type=|&ad_type_|&ad_url=|&ad_zones=|&adbannerid=|&adclient=|&adcount=|&adgroupid=|&admeld_|&admid=|&adname=|&adnet=|&adnum=|&adpageurl=|&adsafe=|&adserver=|&adsize=|&adslot=|&adslots=|&adsourceid=|&adspace=|&adstype=|&adType=PREROLL&|&adunit=|&adurl=|&adv_keywords=|&advert_|&advertiserid=|&advid=|&advtile=|&adzone=|&banner_id=|&clicktag=http|&customSizeAd=|&displayads=|&expandable_ad_|&gIncludeExternalAds=|&googleadword=|&jumpstartadformat=|&largead=|&maxads=|&popunder=|&program=revshare&|&prvtof=.*&poru=|&show_ad_|&showad=|&simple_ad_|&smallad=|&smart_ad_|&strategy=adsense&|&type=ad&|&UrlAdParam=|&video_ads_|&videoadid=|&view=ad&|\+advertorial\.|\+adverts\/|-2\/ads\/|-2011ad_|-300x100ad2\.|-ad-001-|-ad-180x150px\.|-ad-200x200-|-ad-24x24\.|-ad-300x250\.|-ad-313x232\.|-ad-336x280-|-ad-340x400-|-ad-400\.|-ad-banner\.|-ad-big\.|-ad-bottom-|-ad-button-|-ad-category-|-ad-choices |
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
{ | |
"Grey0": [0, 0, 0], | |
"NavyBlue": [0, 0, 95], | |
"DarkBlue": [0, 0, 135], | |
"Blue3": [0, 0, 215], | |
"Blue1": [0, 0, 255], | |
"DarkGreen": [0, 95, 0], | |
"DeepSkyBlue4": [0, 95, 175], | |
"DodgerBlue3": [0, 95, 215], | |
"DodgerBlue2": [0, 95, 255], |
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
RegExp.prototype.matches = function* (str) { | |
let moreThanOnce = this.global || this.sticky; | |
let myLastIndex = 0; | |
do { | |
// preserve lastIndex of another .exec() calls on same regexp | |
let savedLastIndex = this.lastIndex; | |
// use own state for lastIndex to match our str | |
this.lastIndex = myLastIndex; | |
let match = this.exec(str); |
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
function *getSymbols(s) { | |
for (var i = 0; i < s.length - 1; i++) { | |
if (s.charCodeAt(i) >> 10 === 0x36 && s.charCodeAt(i + 1) >> 10 === 0x37) { | |
yield s.substr(i, 2); | |
} else { | |
yield s.charAt(i); | |
} | |
} | |
yield s.charAt(i); | |
} |
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
Example #1: | |
ArrayLiteral[Yield] : | |
[ Elision[opt] ] | |
[ ElementList[?Yield] ] | |
[ ElementList[?Yield] , Elision[opt] ] | |
Option #1: | |
ArrayLiteral : |
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
function slice(str, start, end) { | |
let i = 0, pos = 0, legacyStart, legacyEnd; | |
for (let ch of str) { | |
if (i === start) { | |
legacyStart = pos; | |
} | |
i++; | |
pos += ch.length; | |
if (i === end) { | |
legacyEnd = pos; |
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
function awaitableVersionOf(nodeFunction) { | |
return (...args) => new Promise((resolve, reject) => { | |
nodeFunction( | |
...args, | |
(error, ...cbArgs) => error ? reject(error) : resolve(...cbArgs) | |
); | |
}); | |
} |