Skip to content

Instantly share code, notes, and snippets.

💭
(╯°□°)╯︵ ┻━┻

Ingvar Stepanyan RReverser

💭
(╯°□°)╯︵ ┻━┻
Block or report user

Report or block RReverser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jdataview-issue-52.js
'use strict';
var jBinary = require('jbinary');
var FLGTypeSet = {
'jBinary.all': ['array', 'LOG_T'],
'jBinary.littleEndian': true,
STEP_T: {
tempSp: 'float',
@RReverser
RReverser / 1
Created Apr 16, 2016
eval optimization
View 1
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
@RReverser
RReverser / script-data.json
Last active Apr 11, 2016
HTML5 tokenizer tests for script data state
View script-data.json
{
"tests": [
{
"description": "'Hello'</script>BAR",
"initialStates": ["script data state"],
"lastStartTag": "script",
"input": "'Hello'</script>BAR",
"output": [
["Character", "'Hello'"],
["EndTag", "script"],
@RReverser
RReverser / chrome-file-system.js
Last active Mar 12, 2016
Async APIs for accessing files from different sources
View chrome-file-system.js
// 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 {
View usb.ts
declare module chrome.usb {
type Direction = 'in' | 'out';
interface Device {
device: number,
vendorId: number,
productId: number,
productName: string,
manufacturerName: string,
serialNumber: string
View bitflags.js
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();
View adblock-fanboy-complete.js
This file has been truncated, but you can view the full file.
exports.include = [
{
options: {},
View xterm-colors.json
{
"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],
View RegExp.prototype.matches.js
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);
You can’t perform that action at this time.