Skip to content

Instantly share code, notes, and snippets.

View r2p2's full-sized avatar

Robert Peters r2p2

View GitHub Profile
@r2p2
r2p2 / Makefile
Created October 3, 2011 19:25
Makefile
#LIB=liborm_core
#VERSION=1.0
TARGET=lib$(LIBNAME).so
CC=g++
CFLAGS=-fPIC -g -c -Wall -Weffc++ -Iinclude
LDFLAGS=-shared -Wl,-soname,$(TARGET) -Lbuild -lpthread -lrt
# checks to subdir level, add more if requiered
SOURCES=$(wildcard **/*.cpp) $(wildcard **/**/*.cpp)
#!/bin/perl -w
use strict;
use warnings;
my $debug = 0;
my $progress = 1;
my %users = ();
sub print_debug {
if($debug == 1) {
@r2p2
r2p2 / main.go
Created November 29, 2011 20:44
package main
import "image"
func draw(i *image.Image) {
//main.go:8: i.Bounds undefined (type *image.Image has no field or method Bounds)
// But Interface Image says that Bounds has to be
// implemented.
i.Bounds()
}
g++ -o bin/libutils-1.0.so -shared -Wl,-soname,libutils-1.0.so -Lbuild -lpthread -lrt build/crypto/sha512.o build/crypto/md5.o build/crypto/sha1.o build/crypto/hashalgorithm.o build/crypto/sha256.o build/crypto/sha.o build/fs/filedescriptorreactor.o build/fs/filedescriptorobserver.o build/data/databuffer.o build/thread/thread.o build/thread/semaphore.o build/thread/mutex.o build/thread/mutexlocker.o build/uuid/uuid.o build/uuid/statestorage.o build/uuid/generator.o build/uuid/filestorage.o build/net/tcpsocketiostream.o build/net/tcpsocket.o build/net/socketiostream.o build/net/tcpsocketstreambuf.o build/net/socketstreambuf.o build/net/abstract_socket.o
make[1]: Leaving directory `/home/r2p2/git/xer/utils_lib/lib'
cd test/src && cp -aur * ../build/;
cd test/; make LIBNAME=utils-1.0
make[1]: Entering directory `/home/r2p2/git/xer/utils_lib/test'
g++ -o bin/test_utils-1.0 -L../lib/bin -lutils-1.0 -lpthread -lrt build/test_signal.o build/test_md5.o build/test_pipe.o build/test_thread.o build/test_databuffer.o bu
cd test/src && cp -aur * ../build/;
cd test/; make LIBNAME=utils-1.0
make[1]: Entering directory `/home/r2p2/git/xer/utils_lib/test'
g++ -o bin/test_utils-1.0 -L../lib/bin -lutils-1.0 -lpthread -lrt build/test_signal.o build/test_md5.o build/test_pipe.o build/test_thread.o build/test_databuffer.o build/test_sha256.o build/test_sha512.o build/test_uuid.o build/test_sha1.o build/main.o build/test.o
make[1]: Leaving directory `/home/r2p2/git/xer/utils_lib/test'
@r2p2
r2p2 / gist:2011897
Created March 10, 2012 16:12
RS KEY
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQINBE9Kj7cBEADBvYH5fsl3UjDMHSo0ooyIHVgZjytobXcpuXM46ecY2aqVIiFp
fAMQQqdtwKqs/AuEFJDvS9akgWitXdVqoAxNQRkuCOA2ANzqz9fID7HuGLppT2cO
z+cohzB3+2ltJ2mC5RyRO83T5m7LDmsj23tCXO1jdgJ+scLcR9JNstiPKk+Y+X1P
NdX5KxcqIAT3zLmInZO2Dt2XtM0CnwfnQ/aC/fzCa/yFLRm3iCAhsaVoX1nOJ2Rr
ibImtT7NhuFVd4LCLC+PJ2wUlJID98VD6/64wlIeS0uSYz2F+yBYjosrB0ihUA8s
QZXxMhHy4wRHGM7rox5b+ZS0VqIuoS1oM1QunVdfIG+E9/WwcNEEYIXnOxwRWIVP
yZBEBI/3lz7DopV/5DTZ4dBnW1hzyhdBhSWVLA58Uj68MILsmFBtxAoKdjb6mDPM
#!/bin/sh
if [ "x$#" != "x1" ]
then
echo "usage: $0 depth"
echo "depth: "
exit 0
fi
depth=$1
@r2p2
r2p2 / signal.h
Created June 2, 2012 11:44
signals for functors
#pragma once
#include <list>
#include <stdint.h>
#include <tr1/functional>
class NoParam {};
template <
class P1 = NoParam,
#include <iostream>
#include <typeinfo>
#include <vector>
#include <tr1/memory>
struct Base
{
virtual void set(const Base &b)
{ throw "not implemented"; }
@r2p2
r2p2 / gist:3333166
Created August 12, 2012 17:25
c++11
// so viel code brauchte man bisher
std::vector<std::vector<int> > list;
std::vector<int> sublist1;
sublist1.push_back(1);
sublist1.push_back(2);
sublist1.push_back(3);
std::vector<int> sublist2;
sublist1.push_back(4);