Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / aci_theme.css
Created January 15, 2021 21:06
ACI Custom Theme
body {
background: #db0000;
}
#!/bin/bash
# Check if the nomad CLI is installed
if ! command -v nomad &> /dev/null; then
echo "Nomad CLI could not be found. Please install it first."
exit 1
fi
# Get a list of all running jobs
running_jobs=$(nomad job status -short | grep running | awk '{print $1}')