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
@roxlu
roxlu / main.cpp
Created Feb 22, 2014
LibHARU + PDF
View main.cpp
/*
PDF
----
Very basic application which generates a poster from a
set of images. This application was created because I wanted
to have a poster from my instagram images. It uses a couple of
php files that login to my instagram account and generates a
shell script which downloads them to a directory.
View README.md

Mitchell’s best-candidate algorithm generates a new random sample by creating k candidate samples and picking the best of k. Here the “best” sample is defined as the sample that is farthest away from previous samples. The algorithm approximates Poisson-disc sampling, producing a much more natural appearance (better blue noise spectral characteristics) than uniform random sampling.

See also the white-on-black and Voronoi variations of this example.

View krx_dtls.c
#include "krx_dtls.h"
int krx_dtls_init() {
SSL_library_init();
SSL_load_error_strings();
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
return 0;
}
@roxlu
roxlu / test_vorbis.c
Last active Aug 29, 2015
Decoding vorbis flow (w/o cleanup yet).
View test_vorbis.c
/*
test_vorbis
------------
See online version: https://gist.github.com/roxlu/af1ffc1290b9dc37b5b9
Example code which decodes a .ogg file that contains vorbis and/or
some other stream, e.g. theora. We ignore all non-vorbis streams and
simply flush the packets.
@roxlu
roxlu / test_ssl_fingerprint.cpp
Created Jul 29, 2014
Create fingerprint / self signed certficate
View test_ssl_fingerprint.cpp
/*
test_ssl_fingerprint
--------------------
This code shows the following:
- use openssl to generate a private key that can be used to encrypt application data
- extract the fingerprint from the key
@roxlu
roxlu / Parsing_Stun.txt
Created Jul 31, 2014
Some test data that can be used when parsing stun messages (WebRTC/ICE/STUN)
View Parsing_Stun.txt
Below is a dump of a STUN message that can be used to validate your
STUN message integrity check. The password that is used to encrypt
the Message-Integrity is: "Q9wQj99nsQzldVI5ZuGXbEWRK5RhRXdC" (without quotes)
/* Raw STUN message as received from Chrome */
-----------
00 01 00 58
21 12 A4 42
48 75 38 77
@roxlu
roxlu / Reader.cpp
Created Jul 31, 2014
Testing the integrity of stun message. See http://tools.ietf.org/html/rfc5389#section-15.4 and http://tools.ietf.org/html/rfc5769#section-2.2 (validates correctly, code is still work in progress).
View Reader.cpp
#include <stun/Reader.h>
#include <openssl/engine.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
namespace stun {
/* --------------------------------------------------------------------- */
@roxlu
roxlu / test_fex_load_image.cpp
Created Aug 22, 2014
Examples on how to load + reuse memory using rx_load_png and rx_load_jpg
View test_fex_load_image.cpp
/*
test_fex_load_image
-------------------
Plain test which loads + reloads a couple of images and reallocating the
previously allocated buffer when needed. Just a tiny test to speed up
the image loading process.
*/
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
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;
You can’t perform that action at this time.