Skip to content

Instantly share code, notes, and snippets.

@tmatth
tmatth / nginx-lang.lua
Created October 30, 2019 19:37 — forked from mauron85/nginx-lang.lua
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @license: MIT --
-- @requires: --
-- @description: --
-- returns language with greatest quality --
fn pcm_soft_clip(pcm: &mut [f32], nb_samples: i32, nb_channels: i32, declip_mem: &mut [f32]) {
if nb_samples < 1 || nb_channels < 1 {
return;
}
/* First thing: saturate everything to +/- 2 which is the highest level our
non-linearity can handle. At the point where the signal reaches +/-2,
the derivative will be zero anyway, so this doesn't introduce any
discontinuity in the derivative. */

Fuzz Testing Daala

A place where I can keep notes on fuzz testing daala (adapted from https://gist.github.com/iankronquist/a15ad39f7231454c2f61 )

16:50:05         radens | Do you guys run fuzz testers on daala? I was playing around with afl-fuzz
                        | today and was thinking of the recent android bug.
16:53:38      +TD-Linux | radens, no, and we should
16:54:03      +TD-Linux | tons of fuzzing was done on opus, though.
16:54:13         radens | if I wanted to play around with that how would you suggest I get started?

Keybase proof

I hereby claim:

  • I am tmatth on github.
  • I am tmatth (https://keybase.io/tmatth) on keybase.
  • I have a public key whose fingerprint is D89B 52F4 A6B5 0589 0349 ED5E 127B 10EE D876 5B47

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="ringconfigrc"/>
<!--TODO VoipPreferences is a very bad name-->
Let's drop VoipPreferences...this is like the 3rd time that I'm left scratching my head by this.
#include <cstdio>
struct Alice
{
virtual void func()
{
printf("ALICE\n");
}
};
// Simple GNU/Linux OpenGL framework for implementing:
// http://gafferongames.com/game-physics/fix-your-timestep/
//
// Instructions:
// 1) Add the following to Timestep.cpp:
// #include "Linux.h"
//
// 2) Compile with:
// g++ -O2 -g -D__LINUX__ Timestep.cpp -o timestep -lglut -lGL -lGLU -lrt