Skip to content

Instantly share code, notes, and snippets.

View chebum's full-sized avatar

Ivan Nikitin chebum

View GitHub Profile
@chebum
chebum / filter-gain.js
Last active February 3, 2020 13:31
Web Audio API - Find combined amplitude gain of biquad filters
/**
* Calculates maximum gain for a set of biquad filters. The function will calculate
* frequency response in steps specified by precisionHz
*
* @param {BiquadFilterNode[]} filters The array of biquad filters,
* @param {number} precisionHz A resolution in hertz of the calculation - smaller value means higher precision. Default value: 20.
* @return {number} Gain of the filters in dB.
*/
function maxGain(filters, precisionHz) {
if (!filters || filters.length === 0)
@chebum
chebum / qunitjs.d.ts
Created October 12, 2017 12:29
npm qunitjs typings
declare module "qunitjs" {
interface Assert {
/**
* Instruct QUnit to wait for an asynchronous operation.
*
* The callback returned from `assert.async()` will throw an Error if it is
* invoked more than once (or more often than the accepted call count, if
* provided).
*
* This replaces functionality previously provided by `QUnit.stop()` and
@chebum
chebum / AppHangReport
Created December 4, 2012 19:49
App hang report
Thread 0x3a9bc7 DispatchQueue 1 priority 47
24 ??? (JavaApplicationStub + 2680) [0x103434a78]
24 launchJavaApplicationWithJVMInfo + 1484 (JavaApplicationLauncher) [0x10343efb9]
24 startupJava(LauncherArgsStruct*) + 236 (JavaApplicationLauncher) [0x10343c5cf]
24 CFRunLoopRunSpecific + 290 (CoreFoundation) [0x7fff8f81e6b2]
24 __CFRunLoopRun + 789 (CoreFoundation) [0x7fff8f81edc5]
24 __CFRunLoopDoSources0 + 245 (CoreFoundation) [0x7fff8f7fba25]
24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 (CoreFoundation) [0x7fff8f7fc101]
24 __NSThreadPerformPerform + 225 (Foundation) [0x7fff912b4677]
24 -[CPerformer perform] + 93 (libawt.jnilib) [0x110443ffa]