Skip to content

Instantly share code, notes, and snippets.

View adaugherity's full-sized avatar

Andrew Daugherity adaugherity

  • Texas A&M University
View GitHub Profile
@adaugherity
adaugherity / formatJson.js
Last active August 23, 2023 17:34 — forked from lobbin/formatJson.js
Mimic npm 6 --parseable with npm 8 json output
// npm audit --json | node formatJson.js
const fs = require('fs');
function findDependencyPath(json, moduleName) {
if (!json.vulnerabilities[moduleName].isDirect
&& json.vulnerabilities[moduleName].effects.length) {
return `${findDependencyPath(json, json.vulnerabilities[moduleName].effects[0])}>${moduleName}`
}
return moduleName;
}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten