Skip to content

Instantly share code, notes, and snippets.

View kisielk's full-sized avatar
🔈

Kamil Kisiel kisielk

🔈
View GitHub Profile
@hollance
hollance / ProtectYourEars.h
Created June 26, 2022 18:45
For testing audio code with headphones on...
#pragma once
#include <JuceHeader.h>
/**
Silences the buffer if bad or loud values are detected in the output buffer.
Use this during debugging to avoid blowing out your eardrums on headphones.
If the output value is out of the range [-1, +1] it will be hard clipped.
*/
inline void protectYourEars(float *buffer, int sampleCount)
package poison
import (
"database/sql"
"reflect"
"github.com/gorilla/schema"
)
// Convertors for sql.Null* types so that they can be
@derekcollison
derekcollison / gist:4227635
Created December 6, 2012 19:40
Early results from high-performance NATS server
I have some early benchmark results for our work on a high performance NATS server in Go.

Quick Summary:
We can process ~2M msgs/sec through the system, and the ingress and egress are fairly well balanced.

The basics of the architecture are intelligent buffering and IO calls, fast hashing algorithms and subject distributor/routing, and a zero-allocation hand-written protocol parser.

In addition, I used quite a bit of inlining to avoid function overhead, no use of defer, and little to no object allocation within the fast path. I will share more details and the code at a future date.
@dustin
dustin / make-go-compilers
Last active October 13, 2015 07:08
Go Cross Compilation
#!/bin/sh
hg purge -v --all
./make.bash
env GOOS=windows ./make.bash --no-clean
env GOOS=windows GOARCH=386 ./make.bash --no-clean
env GOOS=linux ./make.bash --no-clean
env GOOS=linux GOARCH=amd64 ./make.bash --no-clean
env GOOS=linux GOARCH=386 ./make.bash --no-clean
env GOOS=linux GOARCH=arm ./make.bash --no-clean