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
// ==UserScript== | |
// @name Stack Overflow Sticky Search Filter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.0.0 | |
// @description Use localStorage to remember most recently used search filter | |
// @author Patrick Roberts | |
// @match https://*.stackoverflow.com/* | |
// @grant none | |
// ==/UserScript== |
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 Lookup extends Map { | |
get [Symbol.toStringTag] () { return 'Lookup' } | |
constructor (iterable = []) { | |
super( | |
[...iterable].map( | |
([key, value]) => [ | |
key, | |
value instanceof Set | |
? value |
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
((root, factory) => { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define([], factory) | |
} else if (typeof module === 'object' && module.exports) { | |
// Node. Does not work with strict CommonJS. | |
module.exports = factory() | |
} else { | |
// Browser globals (root is window) | |
root.deobfuscate = factory() |
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
/* | |
* parser.pegjs -> parser.js | |
* https://pegjs.org/online | |
* Use results cache, Optimize parsing speed | |
*/ | |
// import parser generator for grammar defined in parser.pegjs | |
const { parse } = require('./parser') | |
// accepts mapping to convert parameter list into named parameters based on position | |
const args = (expression, map) => (...args) => expression(map(...args)) |
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 Cache extends WeakMap { | |
get (key) { | |
// initialize to empty set | |
if (!super.has(key)) { | |
super.set(key, new Set()) | |
} | |
return super.get(key) | |
} | |
} |
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
`timescale 1ns / 1ps | |
module alu32 (d, Cout, V, a, b, Cin, S); | |
output[31:0] d; | |
output Cout, V; | |
input [31:0] a, b; | |
input Cin; | |
input [2:0] S; | |
wire [31:0] c, g, p; |
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
// ==UserScript== | |
// @name Automated Permalink | |
// @namespace http://tampermonkey.net/ | |
// @version 2.0 | |
// @description automatically synchronizes permalink to fusion | |
// @author Patrick Roberts | |
// @match http://pokemon.alexonsager.net/* | |
// @grant none | |
// ==/UserScript== |
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 characterRange (minCharacter, maxCharacter) { | |
const lower = minCharacter.charCodeAt(0) | |
const upper = maxCharacter.charCodeAt(0) | |
return Array(upper - lower + 1) | |
.fill() | |
.map((_, index) => String.fromCharCode(lower + index)) | |
.join('') | |
} |
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
'use strict'; | |
(function () { | |
WAV.frequency = function frequency(note) { | |
var map = { | |
'REST': 0, | |
'A0': 27.5, | |
'A0#': 29.135, | |
'B0b': 29.135, | |
'B0': 30.868, |
NewerOlder