Skip to content

Instantly share code, notes, and snippets.

View jakubfiala's full-sized avatar

Jakub Fiala jakubfiala

View GitHub Profile
@jakubfiala
jakubfiala / after_iter
Created May 27, 2017 10:36
strange Vec reversal after calling .iter()
After .iter():
[
0.02893070559670266,
0.02936703194102209,
0.030760184075799155,
0.033019285012034535,
0.03669432755302178,
0.041665175580908854,
0.048615361816985184,
@jakubfiala
jakubfiala / fractal.js
Created March 28, 2017 09:38
Fractal config where resources aren't being loaded
const path = require('path');
const fractal = module.exports = require('@frctl/fractal').create();
const mandelbrot = require('@frctl/mandelbrot');
const TPLAdapter = require('./pattern-library/tpl-php-adapter.js');
// PROJECT VARS
fractal.set('project.title', 'Web Components');
fractal.set('project.version', 'v1.0');
fractal.set('project.author', 'Jakub Fiala');
@jakubfiala
jakubfiala / .vimrc
Created September 11, 2016 21:18
my vimrc
" Some of these I've taken from spf13
set nocompatible
filetype plugin indent on
set virtualedit=onemore
set history=1000
set number
set cursorline
" set the runtime path to include Vundle and initialize
@jakubfiala
jakubfiala / custom_console.js
Created February 1, 2016 14:05
this small script intercepts the standard console methods and provides a way of accessing their messages, as well as stack traces, which is really cool. it formats the stack traces for popular browsers
//==========================================================
// CUSTOM JAVASCRIPT CONSOLE
// built by jakub fiala
//
// this small script intercepts the standard console methods
// and provides a way of accessing their messages,
// as well as stack traces, which is really cool.
// it formats the stack traces for popular browsers
//
// contributions welcome!
@jakubfiala
jakubfiala / meyda-v2-offline.js
Last active April 25, 2020 17:47
Offline feature extraction in Meyda v2
//Because meyda v2 doesn't really have an offline extraction API, we need to manually require some stuff
var jsfft = require("./node_modules/meyda/node_modules/jsfft/")
var complex_array = require("./node_modules/meyda/node_modules/jsfft/lib/complex_array.js")
var extractors = require("./node_modules/meyda/dist/node/featureExtractors.js")
var meyda_utils = require("meyda").utils
//this is a simple class for streaming WAV data as Float32Arrays
//available at https://gist.github.com/jakubfiala/cb9de100fdd4f043d46e
//we're not going to use its streaming functionality for simplicity
var WavManager = require("./wav-manager.js")
var fs = require('fs')
@jakubfiala
jakubfiala / wav-manager.js
Last active January 14, 2016 15:25
This is a simple JS class using the wav module in node to read a wav file into a Float32Array
/*
WavManager
==========
simple class to open and stream a WAV file as a Float32Array
by jakub fiala
goldsmiths computing, 2015
@jakubfiala
jakubfiala / metatags.html
Last active August 29, 2015 14:21
My meta tags
<!--
This is a collection of meta tags I'm using at fiala.uk
They're useful for previews when sharing on fb, twitter, etc.
the og- ones are specific for FB open graph API
just edit the attributes to match your website
In case your f***d up URL is already in the OG database, you can repair it here
https://developers.facebook.com/tools/debug/
double maxiFilter::formant(double input, double centerFreq, double q, double gain) {
cutoff = centerFreq;
//offset gain
gain += 1;
//gain *= 4;
//calculate poles and coeffs
w0 = TWOPI * cutoff / 44100;
alpha = sin(w0)/(20*q);
b0 = alpha*gain;