Skip to content

Instantly share code, notes, and snippets.

View RReverser's full-sized avatar
🇺🇦

Ingvar Stepanyan RReverser

🇺🇦
View GitHub Profile
{
"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 has been truncated, but you can view the full file.
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
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();
@RReverser
RReverser / usb.ts
Last active February 16, 2016 22:07
declare module chrome.usb {
type Direction = 'in' | 'out';
interface Device {
device: number,
vendorId: number,
productId: number,
productName: string,
manufacturerName: string,
serialNumber: string
@RReverser
RReverser / chrome-file-system.js
Last active March 12, 2016 21:14
Async APIs for accessing files from different sources
// Chrome extensions/apps API
// Uses Callback #3: (data => { let err = chrome.runtime.lastError; ... }) for Chrome API
// Uses Callback #2: (data => { ... }, err => { ... }) for FileSystem API (also Chrome-specific!)
// Uses Events onload and onerror for File API (HTML5)
// All implemented within one vendor for different APIs (sic!)
chrome.fileSystem.chooseEntry({ type: 'openFile' }, fileEntry => {
if (chrome.runtime.lastError) {
console.error('Error in file open dialog:', chrome.runtime.lastError);
} else {
@RReverser
RReverser / script-data.json
Last active April 11, 2016 12:35
HTML5 tokenizer tests for script data state
{
"tests": [
{
"description": "'Hello'</script>BAR",
"initialStates": ["script data state"],
"lastStartTag": "script",
"input": "'Hello'</script>BAR",
"output": [
["Character", "'Hello'"],
["EndTag", "script"],
@RReverser
RReverser / 1
Created April 16, 2016 15:36
eval optimization
PS C:\Users\Ingvar> node -e "function f() { eval('1') } for (var i=0; i < 10000; i++) f()" --trace-opt
[disabled optimization for 0000035F6F466C59 <SharedFunctionInfo SAR>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F465B81 <SharedFunctionInfo ADD>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F466E69 <SharedFunctionInfo SHR>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F467069 <SharedFunctionInfo IN>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F4ED7C9 <SharedFunctionInfo NativeModule.require>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F4ED721 <SharedFunctionInfo NativeModule>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F466669 <SharedFunctionInfo BIT_OR>, reason: Call to a JavaScript runtime function]
[disabled optimization for 0000035F6F466119 <SharedFunctionInfo MUL>, reas
'use strict';
var jBinary = require('jbinary');
var FLGTypeSet = {
'jBinary.all': ['array', 'LOG_T'],
'jBinary.littleEndian': true,
STEP_T: {
tempSp: 'float',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@RReverser
RReverser / index.html
Created December 21, 2016 11:09
regexgen #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>regexgen</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>