Skip to content

Instantly share code, notes, and snippets.

@roxlu ☾ roxlu

Block or report user

Report or block roxlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View convert_movies.sh
#!/bin/sh
set -x
if [ ! -d ${PWD}/h264 ] ; then
mkdir h264
fi
if [ ! -d ${PWD}/r264 ] ; then
mkdir r264
fi
@roxlu
roxlu / AudioConverterBrain.cpp
Created May 6, 2016
Example implementation of using the amazing b8brain audio samplerate converter, https://github.com/avaneev/r8brain-free-src This was used for a real time audio stream converter.
View AudioConverterBrain.cpp
#include <poly/AudioConverterBrain.h>
#include <poly/AudioDataConverter.h>
namespace poly {
AudioConverterBrain::AudioConverterBrain()
:listener(NULL)
{
}
View cache.cpp
#if 0
/* takes ~0.038ms */
for (size_t k = 0; k < convert_from.nchannels; ++k) {
std::vector<double>& prepared_data = channel_data[k];
for (size_t i = 0; i < nframes; i++) {
prepared_data[i] = src_ptr[k + (i * convert_from.nchannels)];
}
}
#else
/* takes 0.0025 ms*/
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(PluginTest)
add_library(Transportation STATIC Car.cpp SomeFunctions.c)
add_library(Plugin MODULE Plugin.cpp)
target_link_libraries(Plugin Transportation)
@roxlu
roxlu / TestFboChangeBuffer.cpp
Last active Apr 24, 2018
Comparing the performance of different ping/pong techniques when using FBOs. One version uses two fbos and swaps between these, the other switches the draw and read buffer. See these results https://docs.google.com/spreadsheets/d/1ZyTQGkjYQajQtu8OvgRyaXJl46F4rZJStBCEK2kebgE/edit?usp=sharing for a comparison. It seems that switching read / draw b…
View TestFboChangeBuffer.cpp
#include <poly/Log.h>
#include <TestFboChangeBuffer.h>
using namespace poly;
TestFboChangeBuffer::TestFboChangeBuffer()
:fbo(0)
,dx(0)
{
tex[0] = 0;
@roxlu
roxlu / fun.cpp
Last active Jun 28, 2018 — forked from kizzx2/fun.cpp
Using lua 5.2 with C++
View fun.cpp
// fun.cpp
// This is for Lua 5.2, for Lua 5.1, see https://gist.github.com/kizzx2/1594905
#include <lua.hpp>
#include <iostream>
#include <sstream>
class Foo
{
@roxlu
roxlu / fun.cpp
Last active Aug 29, 2015 — forked from kizzx2/fun.cpp
THIS DOES NOT WORK WITH 5.2
View fun.cpp
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@roxlu
roxlu / compile.sh
Created Dec 28, 2014
Apache, PHP and MySQL build script for Mac 10.10
View compile.sh
#!/bin/bash
d=${PWD}
sd=${d}/sources
bd=${d}/build
id=${d}/installed/
PATH_ORIG=${PATH}
CC_ORIG=${CC}
CPP_ORIG=${CPP}
View move.mod
MODULE Server
PERS tooldata myTool:=[TRUE,[[0,0,1],[1,0,0,0]],[1,[0,0,0.1],[1,0,0,0],0,0,0]];
TASK PERS wobjdata myWobj:=[FALSE,TRUE,"",[[400,0,400],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
!CONST robtarget myRobtarget:=[[0,0,0],[0.707107,0,0.707107,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
VAR robtarget myRobtarget:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
VAR socketdev server_socket;
VAR socketdev client_socket;
PROC main()
! SocketCreate server_socket;
View coords.txt
dding: 422.593750, 34.640625
Adding: 422.593750, 36.640625
Adding: 422.593750, 41.863281
Adding: 422.593750, 49.175781
Adding: 422.593750, 66.929688
Adding: 422.593750, 75.285156
Adding: 422.593750, 84.687500
Adding: 422.593750, 93.042969
Adding: 422.593750, 100.355469
Adding: 422.593750, 110.101562
You can’t perform that action at this time.