Skip to content

Instantly share code, notes, and snippets.

View josh-richardson's full-sized avatar
🏠
Working from home

Josh R josh-richardson

🏠
Working from home
View GitHub Profile
@josh-richardson
josh-richardson / userscript.js
Last active December 18, 2020 12:56
Auto-expand GitLab breadcrumb
// ==UserScript==
// @name Auto-expand GitLab breadcrumb
// @version 0.1
// @description GitLab's breadcrumb always collapses even when it doesn't need to, this fixes that, but it may be fragile...
// @author You
// @match https://gitlab.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
@josh-richardson
josh-richardson / Web3RequestLogger.js
Created November 16, 2020 13:03
Horrible hack to intercept Web3js requests in node. Probably extremely fragile.
function Web3RequestLogger(httpProvider) {
let handler = {
get(target, propKey, receiver) {
const origMethod = Reflect.get(target, propKey, receiver);
if (propKey === "send") {
return function (...args) {
console.log(`Sent JSONRPC Request: ${JSON.stringify(args[0])}`);
let responseCallback = function(err, result) {
console.log(`Received JSONRPC Response: ${JSON.stringify(result)}`)
args[1](err, result)