Skip to content

Instantly share code, notes, and snippets.

View Nodonisko's full-sized avatar

Daniel Suchý Nodonisko

View GitHub Profile
WARN Possible Unhandled Promise Rejection (id: 23):
RangeError: Maximum call stack size exceeded (native stack depth)
RangeError: Maximum call stack size exceeded (native stack depth)
at apply (native)
at reactConsoleErrorHandler (http://localhost:8081/index.js.bundle?platform=android&dev=true&minify=false&app=io.trezor.suite.debug&modulesOnly=false&runModule=true:20011:46)
at apply (native)
at anonymous (http://localhost:8081/index.js.bundle?platform=android&dev=true&minify=false&app=io.trezor.suite.debug&modulesOnly=false&runModule=true:30468:35)
at apply (native)
at registerError (http://localhost:8081/index.js.bundle?platform=android&dev=true&minify=false&app=io.trezor.suite.debug&modulesOnly=false&runModule=true:20443:35)
at apply (native)
// There is incomparability in results between nodejs and window SubtleCrypto api.
// window.crypto.subtle.importKey (CryptoKey) cannot be used by `crypto-browserify`.Verify
// The only common format of publicKey is PEM.
const verifySignature = async (rawKey: Buffer, data: Uint8Array, signature: Uint8Array) => {
const signer = crypto.createVerify('sha256');
signer.update(Buffer.from(data));
// use native SubtleCrypto api.
// Unfortunately `crypto-browserify`.subtle polyfill is missing so needs to be referenced directly from window object (if exists)
// https://github.com/browserify/crypto-browserify/issues/221
@Nodonisko
Nodonisko / .zshrc
Created January 13, 2022 20:05
Automatically change Node.js version
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
{"lastUpload":"2022-03-21T14:03:50.078Z","extensionVersion":"v3.4.3"}
@Nodonisko
Nodonisko / app.ts
Last active July 21, 2016 09:29
Ionic 2 Custom URL Scheme integration
import {Component} from '@angular/core';
import {Platform, ionicBootstrap} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {TabsDashboardPage} from './pages/tabs-dashboard/tabs-dashboard';
import {DeepLinkProvider} from './providers/deep-link-provider/deep-link-provider';
@Component({
templateUrl: './build/app.html'
})
export class MyApp {