Skip to content

Instantly share code, notes, and snippets.

@nddrylliog
nddrylliog / android_configure.sh
Created February 1, 2013 00:51
Cross-compile autotools library for Android / arm-linux-androideabi I stick that in ~/bin/, chmod +x, and then run it in place of "./configure" in my project. Then a make and make install later, the prefix contains libraries built for android. Neato eh?
#!/bin/sh
# I put all my dev stuff in here
export DEV_PREFIX=$HOME/Dev/
# Don't forget to adjust this to your NDK path
export ANDROID_NDK=${DEV_PREFIX}/android-ndk-r8d/
export CROSS_COMPILE=arm-linux-androideabi
@nddrylliog
nddrylliog / minimal-cairo.md
Last active January 7, 2022 04:40
Minimal cairo build - for the humanoid who already has everything and just needs vector graphics

You need both pixman and cairo, which you can find here: http://cairographics.org/releases/

Pixman configure:

../pixman-0.32.4/configure --prefix=/root/prefix --disable-libpng --disable-gtk

Cairo configure:

PKG_CONFIG_PATH=/root/prefix/lib/pkgconfig ../cairo-1.12.16/configure --prefix=/root/prefix --enable-xlib=no --enable-xcb=no --enable-xcb-shm=no --enable-win32=no --enable-quartz=no --enable-script=no --enable-ft=no --enable-fc=no --enable-ps=no --enable-pdf=no --enable-svg=no --enable-gobject=no --enable-trace=no --enable-interpreter=no --enable-png=no

@nddrylliog
nddrylliog / luajit-64bit-custom-allocators.diff
Last active July 29, 2021 18:24
LuaJIT modifications needed to re-enable custom 64-bit allocators.
diff --git a/src/lib_aux.c b/src/lib_aux.c
index 05fa6b1..c618094 100644
--- a/src/lib_aux.c
+++ b/src/lib_aux.c
@@ -346,9 +346,11 @@ LUALIB_API lua_State *luaL_newstate(void)
#if LJ_64
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
{
- UNUSED(f); UNUSED(ud);
- fputs("Must use luaL_newstate() for 64 bit target\n", stderr);
@nddrylliog
nddrylliog / structs.c
Created April 28, 2011 00:09
Structs usage example
/* -Wall -Wextra -Werror -std=c89 -pedantic structs.c -o structs */
/* tested with gcc and clang */
#include <stdio.h>
/* forward declaration of struct vector1 */
typedef struct vector1 vector2;
/* actual declaration of struct vector1 */
struct vector1 {
@nddrylliog
nddrylliog / android_toolchain.cmake
Created February 13, 2013 00:06
CMake toolchain for Android
# ------------------------------------------------------------------------------
# Android CMake toolchain file, for use with the Android NDK r5-r8
# Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
# See home page: http://code.google.com/p/android-cmake/
#
# The file is mantained by the OpenCV project. And also can be found at
# http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
#
# Usage Linux:
# $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@nddrylliog
nddrylliog / host-manager
Created November 15, 2011 22:06
A command-line utility to manage the /etc/hosts file.
#!/bin/bash
# Idea and interface taken from https://github.com/macmade/host-manager
path="/etc/hosts"
addusage="Usage: `basename $0` -add host address"
remusage="Usage: `basename $0` -remove host"
case "$1" in
-add)
if [ $# -eq 3 ]; then
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then
@nddrylliog
nddrylliog / hacking-club-mate-imatate.md
Created August 4, 2011 14:08 — forked from Overbryd/hacking-club-mate-imatate.md
Hacking Club Mate "imatate"

Hacking Club Mate "imatate"

Read about the end result here

Join me when I start brewing my first batch of Club Mate. Inspired by a podcast from chaos radio express on the topic "Hackerbrausen" (Hacker's soda, listen here) I want to try this by myself.

So far I have bought all the necessary ingredients and tools to get started. And with the help from Jan (@janl) I can even carbonate the end result :)

When? Where?

@nddrylliog
nddrylliog / result.md
Created November 11, 2011 16:41
cat ~/.bash_history | sort -n | uniq -c | sort -nr | head -15

@nddrylliog
nddrylliog / 00-ogre3D-experiments.md
Last active August 7, 2017 11:56
Documenting my experiments with Ogre3D.

Reading the docs

Seems well-organized, wish I had read that years ago - things I found out about rendering by trial and lots of errors are clearly stated there. It probably helped for comprehension that I struggled with these for years but now things make sense.

Approach is clearly a scene-graph but more involved than libgdx's 3D framework: lots of built-in techniques (e.g. for Shadows), implementations of frequently-used algorithms (BSPs, Octrees), etc.

Own binary model format with pre-computed LODs / edge lists, exporter available from Blender: blender2ogre (supports Blender up to 2.66)

@nddrylliog
nddrylliog / output.txt
Created November 22, 2012 13:02
cubeb make output on mingw
$ make
make all-recursive
make[1]: Entering directory `/g/Dev/cubeb'
Making all in docs
make[2]: Entering directory `/g/Dev/cubeb/docs'
echo "*** Warning: Doxygen not found; documentation will not be built."
*** Warning: Doxygen not found; documentation will not be built.
touch doxygen-build.stamp
make[2]: Leaving directory `/g/Dev/cubeb/docs'
make[2]: Entering directory `/g/Dev/cubeb'