Skip to content

Instantly share code, notes, and snippets.

@wojciak
wojciak / aci_theme.css
Created January 15, 2021 21:06
ACI Custom Theme
body {
background: #db0000;
}
@wojciak
wojciak / aci.proto
Last active October 27, 2019 10:45
ACI Integration API: GRPC
syntax = "proto3";
package audio_node;
service AudioNode {
// 1 connection with all audio channels
rpc StartAudioIngestion (CallId) returns (Empty);
rpc IngestAudio (stream AudioChunk) returns (Empty);
rpc FinishAudioIngestion (CallId) returns (Empty);
@wojciak
wojciak / array-flatten.js
Last active October 24, 2018 04:47
Array flatten
function flatten(arr) {
if (Array.flat) { // because we're all excited that this is finally making production!
return arr.flat(Infinity);
}
if (!arr.some(item => Array.isArray(item))) {
return arr;
}
@wojciak
wojciak / poor-mans-async.cpp
Last active January 20, 2017 10:52
Exploring how to generate multi-threaded async code in c++11/14
#include <thread>
#include <future>
#include <chrono>
#include <iostream>
#include <vector>
double runMeAsync(int n) {
n *= 10000000;
for (unsigned i = 0; i < 100000000; i++) {
n++;
@wojciak
wojciak / dor_imgur_bf.js
Last active February 7, 2016 22:35
DevOps Reactions imgur block fix.
function fixIframe() {
// get the images
var images = $("img[src*=imgur]");
images.each(function(i, image) {
var $image = $(image),
iframe,
content;
// wrap each image into an iframe that pretends we load the images from our local computer
@wojciak
wojciak / git-submod-checkout-prior-1.8.2
Created September 4, 2014 07:51
Git branch submodules prior to git 1.8.2
git submodule foreach -q --recursive 'branch="$(git config -f $toplevel/.gitmodules submodule.$name.branch)" && git checkout $branch'
@wojciak
wojciak / wav2mp3
Last active August 29, 2015 14:05
Wave to mp3
//convert
for i in *.wav; do lame -b 320 -h "${i}" "${i}.mp3"; done
//remove the .wav part
for f in *.mp3; do mv "$f" "${f/.*./.}"; done
@wojciak
wojciak / arrayReference.js
Created August 4, 2014 19:58
Don't bleed arrays
// Cleaning up pixi sprite reference arrays
// Don't
var elements = [];
function() {
elements.forEach(function (element) {
element.parent.removeChild(element);
element = null;
});
@wojciak
wojciak / magicTag.html
Created July 23, 2014 18:00
Writing a full-screen canvas game? Remember
<meta name="viewport"
content="width=device-width, initial-scale=1, minimal-ui, minimum-scale=1, maximum-scale=1, user-scalable=no">
@wojciak
wojciak / addToCanvas.js
Created July 6, 2014 20:51
A dead-simple interface function for adding elements to canvas in PIXI
// A reference to the top-level displayObjectContainer
var scene;
// Definition
var addToCanvas = function (options) {
var container = options.container,
object = options.object,
at = options.at;
/**