Skip to content

Instantly share code, notes, and snippets.

@koresar
koresar / verify-signature.js
Last active May 26, 2023 20:29
WebAuthn "none" signature verification
// The code below was largely taken from:
// https://github.com/strangerlabs/webauthn/blob/9959cb2b5f87692b8b1fecd799dd4029a3bf61b1/src/Webauthn.js#L501
const crypto = require("crypto");
const base64url = require("base64url");
const cbor = require("cbor");
function parseAttestationObject(attestationObject) {
const attestationObjectBuffer = base64url.toBuffer(attestationObject);
return cbor.decodeAllSync(attestationObjectBuffer)[0];
// Source of https://www.npmjs.com/package/physical-cpu-count
'use strict'
const os = require('os')
const childProcess = require('child_process')
function exec (command) {
const output = childProcess.execSync(command, {encoding: 'utf8'})
return output
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active June 9, 2025 22:16
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*