Skip to content

Instantly share code, notes, and snippets.

View demesne's full-sized avatar

Kumar Abhinav demesne

View GitHub Profile
(function() {
const origCreate = navigator.credentials.create.bind(navigator.credentials);
const origGet = navigator.credentials.get.bind(navigator.credentials);
// Helper: Converts nested ArrayBuffers to Base64 so JSON.stringify can "see" them
const prepareForString = (obj) => {
if (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)) {
return btoa(String.fromCharCode(...new Uint8Array(obj)));
}
if (Array.isArray(obj)) return obj.map(prepareForString);
if #available(iOS 15.0, *) {
// --- Platform Authenticator (e.g., Face ID, Touch ID) ---
if registrationOptions.authenticatorAttachment == .platform || registrationOptions.authenticatorAttachment == nil {
let provider = ASAuthorizationPlatformPublicKeyCredentialProvider(relyingPartyIdentifier: registrationOptions.rpId)
let request = provider.createCredentialRegistrationRequest(challenge: registrationOptions.challenge, name: registrationOptions.name, userID: registrationOptions.userID)
if !registrationOptions.excludeCredentials.isEmpty {
request.excludedCredentials = registrationOptions.excludeCredentials.map { ASAuthorizationPlatformPublicKeyCredentialDescriptor(credentialID: $0) }
}
request.userVerificationPreference = registrationOptions.userVerificationPreference
@demesne
demesne / Arch Linux with Gnome on VirtualBox.md
Last active December 3, 2017 01:14
No fuss Arch Linux with Gnome on VirtualBox

Install Arch Linux with Gnome

You're going to need the ISO so go get that

Enable SSH

systemctl start sshd
passwd
ip a
@demesne
demesne / windows-setup.ps1
Last active July 17, 2017 20:08
windows-setup.ps1
scoop install 7zip git openssh --global
scoop bucket add extras
scoop bucket add dev-bucket https://github.com/demesne/dev-extras
scoop install nodejs-lts oraclejdk maven tortoisesvn mobaxterm --global
scoop install sublime-dev jetbrains-toolbox
scoop install coreutils grep sed less curl sudo
@demesne
demesne / builddev.sh
Last active June 17, 2017 13:44
New Mac dev machine build script - dot files, home-brew, sublime, iterm2, python, node, ruby, chrome and flux.
#!/usr/bin/env bash
developer_dir = `/usr/bin/xcode-select -print-path 2>/dev/null`.chomp
developer_dir.empty? || !File.exist?("#{developer_dir}/usr/bin/git")
# Update software
echo "Updating mac.."
softwareupdate --install --all
echo "Installing oh-my-zsh.."
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Ember Performance</title>
</head>
<body>
<script type="text/x-handlebars">
<h2>Hello {{mytext}}!</h2>
<br />