Skip to content

Instantly share code, notes, and snippets.

View ashleydavis's full-sized avatar

Ashley Davis ashleydavis

View GitHub Profile
@ashleydavis
ashleydavis / Node.js require hook.js
Last active September 22, 2019 09:16
This snippet of code sets up a hook to intercept calls to require in Node.js. Put this code at the entry point of your app. It's a great debugging tool for Node.js and it even works under Electron!
//
// Original code here.
//
// https://stackoverflow.com/a/41674522/25868
//
const m = require('module');
const originalLoader = m._load;
m._load = function(request, parent, isMain) {
@ashleydavis
ashleydavis / parsing log data.md
Last active November 6, 2019 10:48
An example of parsing log data for later transformation, analysis and visualization with Data-Forge

This markdown was exported from Data-Forge Notebook

Example of parsing log files so you have structured data to use with Data-Forge

First define some test data:

@ashleydavis
ashleydavis / typescript-compiler.ts
Created April 30, 2020 08:36
An example of using the TypeScript compiler from TypeScript
import * as path from "path";
import { IDiagnostic } from "./language-code-generator";
import { readJsonFile } from "../common/file";
//
// Result of compiling TypeScript code.
//
export interface ICompilationResult {
code?: string;
diagnostics: IDiagnostic[];
@ashleydavis
ashleydavis / graph.ts
Last active October 10, 2024 04:28
Searchs backwards iteratively through a graph from the head nodes to find the set of last common ancestors that all paths pass through and that are reachable from the head nodes.
//
// Search backwards iteratively through a graph from the head nodes to find the set of last common
// ancestors that all paths pass through and that are reachable from the head nodes.
//
export function findLastCommonAncestor(blockGraph: BlockGraph, blocks: string[]): IBlockNode[] {
if (blocks.length === 0) {
return [];
}
//
@ashleydavis
ashleydavis / readme.md
Last active June 9, 2025 00:23
Script for tools setup on Ubuntu Linux.

Development Tools Manager

A comprehensive shell script for managing development tools on Ubuntu 24. Install, update, list, and uninstall your essential development tools with a single command. Now supports 16 tools including JSON processing capabilities, HTTP clients, Microsoft enterprise tools, and remote access solutions.

Features

  • 🚀 One-command installation for all your development tools
  • 📋 Status overview showing installed/missing tools and versions
  • 🔄 Individual tool management - install, update, or remove specific tools
  • 🧹 Clean uninstallation with proper cleanup of repositories and keys